websockets: implement onclose