Fixed a synchronization bug which could set the state of a connection to start before state is enqueued