Fix build with DEBUG_LOCKORDER

Fixes #4771