Create the snapshot of `CConnman::vNodes` to operate on earlier in
`CConnman::SocketHandler()`, before calling `CConnman::SocketEvents()`
and pass the `vNodes` copy from the snapshot to `SocketEvents()`.
This will keep the refcount of each node incremented during
`SocketEvents()` so that the `CNode` object is not destroyed before
`SocketEvents()` has finished.
Currently in `SocketEvents()` we only remember file descriptor numbers
(when not holding `CConnman::cs_vNodes`) which is safe, but we will
change this to remember pointers to `CNode::m_sock`.
This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/21943 | core#21943]]
https://github.com/bitcoin/bitcoin/pull/21943/commits/664ac22c5379db65757fc3aab91fff8765683e7f
Depends on D17106