[perl #123495] Stop gmtime(nan) from crashing

We were getting a time struct like this:

$12 = {
  tm_sec = -2147483588,
  tm_min = 2147483647,
  tm_hour = -2147483624,
  tm_mday = -2147483647,
  tm_mon = 11,
  tm_year = 69,
  tm_wday = -2147483641,
  tm_yday = -2147483314,
  tm_isdst = 0,
  tm_gmtoff = 0,
  tm_zone = 0x1004f6bb6 "UTC"
}

which resulted in dayname[tmbuf.tm_wday] reading past the beginning
of the array.  We should check for nan explicitly instead of falling
through to the time calculations.