Ensure UNIX socket credentials are valid on BSD

Ensure that the socket credentials we got back on BSD are valid before
using them.