Use poll() instead of select() when available

select() has the major drawback that it cannot handle file descriptor
that are bigger than 1024. This patch makes use of poll() instead of
select() when poll() support is available.
Link utils against winsocks
Fix missing include
Fix missing include for macOS
Fix header inclusion
Fixed a typo
Fix invalid timeout

timeout was set to 1000ms while in the old code it was 1000us. As 1ms
seems too small set it to 10ms.
Add a guard on nCount with MAXIMUM_WAIT_OBJECTS + cosmetic fixes
Merge pull request #1942 from hardening/kill_select

Use poll() instead of select() when available