[CORE] Add cluster and index state checksums

This commit adds checksumming for cluster and index states. It moves
from a plain XContent based on-disk format to a more structured binary
format including a header and footer as well as a CRC32 checksum for
each of these files. Since previous versions didn't write any format
identifier etc. this commit adds a file extension `.st` for states
that have header/footer and checksum.
This commit also moves over to write temporary files and moves them into
place with an atomic move operation. This commit also serializes and
deserializes the states without materilazing them into opaque memory.

Closes #7586
It would be nice if Lucene could return a generic "CorruptionException", since "CorruptIndexException" for the global cluster state seems strange, since the index is not corrupt, the global state is.

I'll work on a patch to Lucene for it if you agree :)