[BUGFIX] Package Manager needs to sort active packages in dependency order
Problem: If being in production context and the configuration cache is still empty,
it might happen that $this->activePackages is not sorted in the correct order of
package dependencies, but $this->packages is. This leads to wrongly merged configuration,
which is then cached.
This problem might also occur in development context, but only on first hit. After
a reload it is gone.
This change is a fix which makes sure the order in activePackages is the same
as in packages.
Releases: master, 2.0