[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
Here we end up reading the state files for all earlier-version state files, even if we don't use the state. Do you think it would be better to determine the latest file in one pass, then read only that file afterwards?

In this example, if you have:

```
state-v1
state-v2
state-v3
state-v4
```

All 4 versions will be read with `format.read(...)` even though the state from `state-v4` is the actual state we want to keep, especially if there happens to be a corrupted-but-earlier version of the state file on disk, we could skip it entirely but instead we'll read it and throw an exception which is caught and logged/ignored. (I know we shouldn't have all these different versions of cluster state around, but we planning for them is a good idea).

I don't think this will be /bad/, just that it could be more efficient. What do you think?