Properly pass the handler's state to websocket_terminate/3 on close