Fix a time_t size bogosity.

It's time_t sized, assuming long without a cast is wrong.
Hush a windows.h inclusion gripe.
Allow compiling with recent mingw (getaddrinfo() woes).
Conditionalize the definition of ARRAYSIZE.

Win32 has it, with a bizarre implementation.