Avoid detecting locks that only involve one thread
Fix deadlock analysis