Enhancement: Reduce memory consumption of in-memory index

We've improved how the index is stored in memory.
This change reduces memory usage for large repositories by about 30-40%.

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