Fix race in peer data sending
Fix race in peer data sending

- Thread 1 `connectToPeer`, Determines it has to send the peer data and
  does so.
- Thread 2 `connectToPeer` establishes connection.
- Concurrently, thread 1 closes up via `disconnectFromPeer`, updating
  the shared state to indicate no connections to that peer.
- Thread 2 checks the shared state, determines that it must send peer
  data.

But the peer never lost all connections to the local node, because
thread 2 connected before thread 1 disconnected.

This race is fixed: the responsibility is determined before a connection
attempt is made.

input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,serokell/tw-rework-sketch