Include <sys/endian.h> instead of <endian.h> on FreeBSD, NetBSD, and DragonFly.
Fix endian.h header location for several BSD systems. I am the maintainer of the FreeBSD port and this was causing a build failure for me. AFAIK NetBSD and DragonFly also need <sys/endian.h>, but OpenBSD should use <endian.h> in the userland.