Fix segfault for certain invalid WebSocket input.