Consistent time_t handling

Make time_t handling consistent throughout the code base.
Fix few assumptions that time_t == long. For example OpenBSD switched to 64-bit time_t which would cause data loss at some places. 
- Fix these by printing time_t by casting to (long long) and using "%lld".
- Remove unnecessary casts time((time_t *)NULL) => time(NULL)