Revert to older snapshots if the latest raft snapshot is corrupted

Fix #1040