os/time: fix os_localtime_r on win + add func_attr

- it makes no sense for these functions to take NULL pointers
- if `localtime()` on Windows returns a NULL pointer, the old code would try
  to dereference it.