fetchPackages': Close tarfile earlier
fetchPackages': Close tarfile earlier

Prepare to split this function to have unit tests for it.

This change should be harmless but is not a refactoring, separating this
for testing.

martin-kolinek/stack,AndrewRademacher/stack,AndreasPK/stack,deech/stack,anton-dessiatov/stack,MichielDerhaeg/stack,MichielDerhaeg/stack,martin-kolinek/stack,juhp/stack,Blaisorblade/stack,AndreasPK/stack,AndrewRademacher/stack,juhp/stack,Fuuzetsu/stack,mrkkrp/stack,deech/stack,mrkkrp/stack,Fuuzetsu/stack,anton-dessiatov/stack,Blaisorblade/stack