Deadlock status code

Fixes #1922