Handle spurious deadlocks properly
unit test for deadlock detection
Merge pull request #1421 from marcel-blonk/PLFM-2891

Handle spurious deadlocks properly