Enhancement: Reduce memory use in `check`, `copy`, `diff`, and `stats`

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

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