Don't raise the error event when stopping the connection.

- Never throw an operation cancelled exception from the websocket handler,
  just let it throw normally.
- Added functional test.