endian: MacOS X support for endian conversion macros

betohX/htobeX are only available on GNU/Linux.  This change introduces a
header file that maps these functions to the ones available on MacOS X.