[tsan] in deadlock detector do not register locks on their creation and unregister them on destruction; added a relevant test