Handle spurious deadlocks properly