Ticket #47750 - Creating a glue fails if one above level is a conflict or missing
Description: Poring changes made to 1.2.11 branch to newer versions.
1) Enabiling cache lock in cache_is_in_cache and cache_has_otherref.
2) Removing unused field new_entry_in_cache from "struct _modify_context".
(cherry picked from commit 5ae13072330e9a769a5949b2e8a91085b38ac4e1)
(cherry picked from commit ef766784ed7d09aa81e82316b621e8490a368dc6)