[NaCl SDK] nacl_io: implement getaddrinfo()

Change gethostbyname such that is implemented in
terms of getaddrinfo().

Change lookups such that purely numeric lookups don't
rely on the PPAPI interface at all.

Add lock to gethostbyname() so that it at least won't
crash when run from multiple threads.

I'm sure there are still edge cases where this version
of getaddrinfo does the wrong thing, but I've tried to
cover all simple uses with unittests.

BUG=315197
R=binji@chromium.org

Review URL: https://codereview.chromium.org/99933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249510 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 249510