net: also wait for exceptional events in Sock::Wait()
Summary:
This mimics closely CConnman::SocketEvents() and the underlying
poll(2).
rename ERR to err in sock.cpp::Sock::Accept to fix warning declaration shadows a static data member of 'Sock'
This is a partial backport of core#24356
https://github.com/bitcoin/bitcoin/pull/24356/commits/cc74459768063a923fb6220a4f420eaf211aee7b
Depends on D17131
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17132