This is a piece of #21878, chopped off to ease review.
- convert standalone
IsSelectableSocket()toSock::IsSelectable() - convert standalone
SetSocketNonBlocking()toSock::SetNonBlocking()
This further encapsulates syscalls inside the Sock class and makes the callers mockable.