Issue #1404.  WAL consistency check and restore procedure were added.