ensures that the celt header is written as little endian, and also checks