[sanitizer] add tests for DeadlockDetector, minor fix in onLock