UNDERTOW-334 Use 1006 for the close code if the close was intiated locally
UNDERTOW-335 @OnClose is called twice for normal websocket closures
Make sure to treat the response as commited if sendError is called