After sending the headers message add a sync, so that we wait until the header message from the previous peer has been received before connecting additional peers. In the failed NetBSD run linked in #32090, the second node managed to complete the handshake and send its own headers message before the message from the first node was received.
Fixes #32090