[sanitizer] speedup deadlock detector for the case when we acquire the first lock in a thread