Replace gethostbyname with inet_aton

It's less capable, but it works around the fact that gethostbyname cannot
be statically linked.
Linux static link libgcc and libstdc++ statically