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.
I think we need it only for `sendPacket`.
I will fix it later.