Use Tempfile to facilitate atomic replace of hostsfile