`dup` the time before calling `localtime`

Looking at the C implementation, it seems `Time#localtime` may or may
not try to modifiy the time instance, depending on your current time
settings.