GetPrimaryIP is IPv4 only

Summary: GetPrimaryIP uses gethostbyname which is IPv4 only.  Now we cache
both the IPv4 and IPv6 address of the host so SERVER_ADDR can be set based
on the request being made.  Without this change, $_SERVER['SERVER_ADDR']
on IPv6 only hosts would return the hostname instead of an ipaddress
for xbox-server and libevent-server.  Unfortunately with libevent-server,
access to the remote client fd would allow getting the server's
address, but it is not, so use this hack for now.

Also, retire safe_inet_ntoa in favor of folly:IPAddress

Reviewed By: @bmatheny

Differential Revision: D1658651

Signature: t1:1658651:1415566504:ab034dbef2e19613b4d1fc14899c4df852158e96