Fixed deadlocks in ht_ssh