wal/format: refactor the log storage format.
wal/format: refactor the log storage format.

In this commit, we have the HardState stored in the same place with wal entries.
In order to distinguish log entry between hard state, we set 1-byte type field
before every entry and hard state. Another difference is we store multiple
entries in batch and rather than store a 4-byte checksum for each entry,
we store checksum for each batch.

The crc field followed by a 4-byte length recording the length of a batch.
It's useful for calculating the checksum before we parse the batch.

neverchanje/consensus-yaraft,neverchanje/yaraft-wal,neverchanje/yaraft-wal,neverchanje/consensus-yaraft,neverchanje/consensus-yaraft,neverchanje/yaraft-wal,neverchanje/consensus-yaraft