Prior to this commit, the loader git would keep the packfile reference and iterate over
it multiple times per object type. In this commit, we try to drop the packfile reference
earlier to release that reference as soon as possible.
This should reduce the memory pressure on loading very large repository. Assuming the
python dict takes less space than the packfile.
Related to T3625