Fix rare race condition that might have caused WebSocket connection process to crash when CONNECT packet is not fully received until idle timeout passes.