Fix LOCK call to use the new LOCK system
Enable -DDEBUG_LOCKORDER for daemon