Move SocketEvents logic to private method.
Summary:
This separates the select() logic from the socket handling logic, setting up
for a switch to poll().
Partial backport of Core PR14336
https://github.com/bitcoin/bitcoin/pull/14336/commits/28211a4bc9c65859b641b81a0541726a0e01988f
Depends on D6460
Test Plan:
ninja ninja check-all src/bitcoind -debug=net
Verify normal node behavior.
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, majcosta, jasonbcox
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, majcosta, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D6461