Simplify the way we handle `gettimeofday()` fallback for platforms
without native support or without any support. Make it similar to
how we handle `snprintf()`.
In case of no native `gettimeofday()` support and a non-Windows
platform, our local fallback returns zero in `tv_usec` and `tv_sec`,
ending up with a zero `timeout_remaining` in `session.c`, same as
before this patch.
Also:
- drop unused `sys/time.h` headers.
- fix our fallback code to compile with any Windows compilers
(not just MSVC)
- delete unnecessary casts.
Closes#1001