ws: Fix race condition during ssh transport shutdown

Without this change on certain machines, in certain environments
we would see messages like the following:

cockpit-protocol-Message: 127.0.0.1: failed to process channel: Socket error: Success

Closes #657
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>