tcp: check for poll(2) and select(2), workaround for shutdown(2) API
The poll(2) API is not universally available. Check for its presence
before referencing it. Fallback to select(2) in its absence. Check for
the availability of select(2) as well. If neither is available, there
is no (portable) way of checking a file descriptor's readability.
The SHUT_RDWR identifier is not available in winsock. But a different
symbol with identical meaning is available. Use it as a fallback.
This amends commit
fcab496c12b2 which introduced common TCP support.