Exceptions thrown when sending or receiving messages would leave the WebSockets transport in a half-closed state when one of the loops is closed but the other one is still running preventing from the Connection.Closed event to be fired. Fixes: #412