Patch test to be endian aware

The test/simple/test-smalloc.js has an implicit assumption
of the byte order of the data stored for Double and Uint32
values. On a big endian platform this test fails without
these patches.

An isLittleEndian() helper is introduced, and it is used
to gate the static value used for comparison.