Fix lock_time being overwritten by subsequent calls to localtime()