afsocket: Implement UNIX credentials support for FreeBSD

FreeBSD supports passing UNIX credentials over UNIX sockets, but in a
different way than Linux. This patch adds auto-detection and a little
wrapping, and ports the functionality to FreeBSD, and with that,
closes #182.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>