Fix UNIX sockets on FreeBSD.

Fixes #5567