fix: check the type of the initial packet
fix: check the type of the initial packet

Before this fix, the client could mark the polling transport as open
even though the handshake packet was not received properly (for
example, after a parsing error).

This could lead to writes (POST requests) without "sid" query param,
which failed with:

```
{"code":2,"message":"Bad handshake method"}
```

Related:

- https://github.com/socketio/engine.io-client/issues/636
- https://github.com/socketio/socket.io-client/issues/1390

Automattic/engine.io-client,socketio/engine.io-client,socketio/engine.io-client,socketio/engine.io-client