[sanitizer] make sure the deadlock detector survives the change of epochs; add a test and a comment