os/time: include time.h in os/time.h

Include what you use, also in the positive direction.
os/time: make os_get_localtime more portable

gettimeofday() doesn't exist on Windows, as reported by @equalsraf. It seems
a call to time() would be sufficient here, as only the seconds since the
UNIX epoch are needed.