fix the way endianness is detected

see this thread: http://lua-users.org/lists/lua-l/2008-11/msg00075.html
Fix the wrong position of the bracket
Merge pull request #24 from edwardrf/master

Fix endianness detection by checking the actual endianness flag rather than part of the magic number.