[PATCH 6.5 178/211] dm: fix a race condition in retrieve_deps