Fix endianness detection on OS X

Signed-off-by: Sergey Nizovtsev <snizovtsev@gmail.com>