Fixed endianness related issues.

Fixed swap_data function (sam.c): Four bytes that hold
the value of number of elements in an auxiliary data array
have to be swapped at different times for reading/writing.

In cram/os.h system endianness wasn't being properly detected.

In cram/cram_encode.c (function cram_encode_aux) 'count'
variable bytes have to be swapped on big endian machines.

In test/sam.c reference byte array for checking has to be
in big-endian format on big-endian machines.
Fixed alignment issues.

Avoid unaligned memory access on architectures
that don't support it.