websocket: add minimal protection against resource exhaustion.