Added WebSocket closure when no handlers are registered.