Enhancement: Reduce `check`, `copy`, `diff` and `stats` memory usage

The `check`, `copy`, `diff` and `stats` commands now use less memory
when handling large snapshots.

https://github.com/restic/restic/pull/5610
