Fix deadlock detection.