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

Should fix errors like this:

```
couldn't write: Remote channel is closed
```