Improve close logging for WebSocket