This attempts to organize all needed items and places appropriate defines
in a single location. Redundant comparisons/defines were removed when noticed.
A few caveats, however:
* This may be better targeted towards the 5_1_0 branch instead of master right now.
* Cmake will run a little slower on configuration/generation now. That's due to the sanity checks it runs.
* There are some more checks to be added later, but this should be a solid start.
Thanks to the [libical](https://github.com/libical/libical) project for inspiration.
A minor change to the code exposes the timeout parameter of `select()`, which was already in use for CanRead()/CanWrite(). The timeout parameter is used to block the current thread until data (for read) or space (for write) is available on the underlying socket.
A timeout of 0 suppresses any blocking (the original methods fix the timeout to 0).
The timeout value is supplied in milliseconds as an `unsigned int`; this is converted internally to the equivalent `timeval`.
An in-progress addition to my SextetStream input driver is implemented with non-blocking reads on a TCP socket. Without the block+timeout functionality, it must busy-wait for new input. Changing the reads to blocking works during a game but can cause the program to hang when exiting. The changes in this commit provide a solution to both issues without disrupting any existing code.