Avoid clang/32 optimization affecting IEEE endian detection

This turns the detection code into a c++ file, moves the
structure to a global one and adds volatile specifiers.
This should hopefully prevent any standard-adhering
compiler from touching the data.

Change-Id: I6f4b86ddf6b0567655466e0877bb1ba39a45ce4e