Support 64-bit time-t on NetBSD.

Fixes from Robert Swindells.
Minor tweaks for solaris.
Support 64-bit time-t on NetBSD.

Fixes from Robert Swindells.