Defer close while upgrading a transport

https://github.com/Automattic/socket.io/issues/1668

Wait for upgrade to finish since a close packet can't be sent while pausing a transport. 
I'm not so confident yet, but we need to add `closing` readyState for making clear the current state.
Do we have a similar check in `sendPacket`?