smurf: Provide internal timegm() function

timegm() is a BSD/GNU extension and so not POSIX. Provide internal
non-threadsafe version as described in timegm(3) man page on Linux
and OS X.

We may want to use native timegm in preference based on a configure
test.