freebsd/cred: fix group size calculation
Portability fixes for FreeBSD

fd passing now works on FreeBSD.

Chnage macros for constants to functions. The values differ between
OS'es. SOL_SOCKET is a constant in procket.hrl. It will need to be
changed to return a value based on OS.

Fix the padding for structs on FreeBSD. The ucred structure on Linux is
called cmsgcred on FreeBSD. Further work is required to support
credential passing.
Support credential passing on FreeBSD

FreeBSD can pass credentials on any Unix socket, as long as the cmsghdr
with an allocated struct cmsgcred is attached as ancillary data.

In contrast, Linux will allocate the struct ucred if SO_PASSCRED is set
on the socket.