Add check when locked thread has no owner, or if locked thread does not exist anymore.