Make git_index_read_tree preserve stat cache where possible

Instead of just blowing away the stat cache data when loading a new tree into the index, this checks if each loaded item has a corresponding existing item with the same OID and if so, copies the stat data from the old item to the new one so it will not be blown away.

This isn't exactly lovely, but we don't use `git_index_read_tree` in many places, so I wasn't sure how much time was worth investing in it. In particular, this will help the `git_reset` API to not blow away the stat cache when reloading a tree into the index when not much has actually changed on disk.