Use new Network.are_host_same() equivalency check

Replace the existing "is localhost" checks with the new, more reliable method.
We can remove this try/catch because previously, the DeployTarget constructor had called a socket() library function that potentially threw a socket.gaierror in during the is_localhost check. That is no longer necessary!