More endian detection

Since __BYTE_ORDER__ only avaliable since GCC 4.6.0, add more detection.