Fixing the deadlock guard implementation, it was referencing wrong
thread.