Handle systems without getprotobyname()

As before, this is really for Android.