Portability fixes to time_t handling and OpenBSD tweaks

Fix time_t generated warnings. OpenBSD switched to 64-bit time_t so code can't assume time_t == long.
Also included are other OpenBSD related fixes and tweaks.