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/75e8bf55f5a014faada7712a9640dc35e8c86f15
Depends on D17106