Optimize UnixAddr for the BSDs
Optimize UnixAddr for the BSDs

On BSD-derived operating systems, struct sockaddr has a sa_len field
that holds the length of the structure.  UnixAddr's path_len field is
redundant.  Remove path_len on BSD-derived OSes, retaining it only for
Illumos and Linux-based OSes.

Also, ensure that two UnixAddrs compare equal if they differ only by the
presence of a trailing NUL.  On Linux, syscalls like getsockname add a
trailing NUL to the sockaddr they return, even if no NUL was present on
the sockaddr originally passed to the kernel via a syscall like bind,
and even though the docs explicitly say that any NUL passed to bind is
not considered to be part of the address.  Work around this bug by
stripping it in UnixAddrKind::get(), so that at least two UnixAddrs will
compare identical even if they differ in the presence of a trailing NUL.

nix-rust/nix,nix-rust/nix,asomers/nix,asomers/nix