Closes the connection gracefully. It is expected that a future call to WsProtocol.Listener.networkError is made