smurf: Change my_timegm to be thread-safe

Now uses the 'Seconds since the Epoch' formula from the
Single Unix Specification ch 4.14, available at
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_14

mktime(3) normalizes the struct tm and ensures tm_yday is filled in.