Previously Sock::Wait() would not have signaled to the caller whether a timeout or one of the requested events occurred since that was not needed by any of the callers.
Such functionality will be needed in the I2P implementation, thus extend the Sock::Wait() method.
This is a backport of core#20685 [11/20]
https://github.com/bitcoin/bitcoin/pull/20685/commits/ea1845315a109eb105113cb5fbb6f869e1cf010c
Depends on D11019