minor modules.dnsutil._to_seconds() cleanup

rename `time` arg to avoid shadowing imported `time` module
catch more specific exception when doing conversion to int
Merge pull request #15982 from hulu/dnsutil

minor modules.dnsutil._to_seconds() cleanup