MDL-67594 core_lock: Modify postgres get_lock() to avoid recursion