Support coexisting use of replay + regular connections

All state modifications happen in a queue
Making a new connection kills the old one
A new socket object is created for each new persistent connection
Only persistent connections are restarted
Only delegate callbacks for the current socket are processed