loci: fix byte swapping on OS X

The endian.h functions don't exist on OS X, so use the LOCI versions instead.
Also change the byte order macro used to one that's defined on both Linux and OS X.
loci: fix implicit truncation warning

The compiler complained about this in constant expressions.
Merge into master from pull request #203:
loci: fix byte swapping on OS X (https://github.com/floodlight/loxigen/pull/203)