Fix broken box/socket.test.

The Linux fix was broken by portability changes when
porting to FreeBSD.
When checking for a special case of getaddrinfo() failure,
check for both, EAI_BADFLAGS and EAI_ADDRFAMILY.
Merge branch 'stable'
Merge branch 'master' into remote