Fix endian checking to be compatible with AIX