Race condition when calling subscribe to upgrade a connection to PubSub mode multiple times

If you call subscribe on the same connection multiple times in quick succession each call will attempt to upgrade the connection to PubSub mode and deadlock.