Provide gethostbyname_r emulation for FreeBSD and fix zap call to setstate to include...