Fix racy connection handshake