wal: save latest state into new WAL

So we could always read out state when open at valid index.