ws: Fix issue where remote channel is closed when sending data

Should fix errors like this:

couldn't write: Remote channel is closed

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