[FIX] REST: use global lock if context-dependent locks are found. #666