Track target package bases separately

This fixes a bug introduced by tracking names separately to ensure
installation order is preserved. Since packages are presented by name,
but installed by base, we actually need to preserve both via auxiliary
arrays.