workaround for systems not providing pselect

using a mix of good old select and sigprocmask

Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
use betoh64 if be64toh not found

Instead of looking for htobe64 which is be available both when
be64toh or betoh64 are, check for the latter functions.  If we
find betoh64 but not be64toh, use compat #defines.  If both
can't be found, search for OSX' OSSwapHostToBigInt64.
Also include sys/types.h in byteorder.h (which is necessary for
byteorder functions on OpenBSD), and incidentally fixes build
of networkfragment.cc.

Fixes build on OpenBSD

Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>