[BUGFIX] Sorting of packages by dependency

Implement proper dependency handling in Flow PackageManager.
The code ensures that all framework packages are loaded first.

Releases: 6.2
Resolves: #52828
Change-Id: I6717756efae28b1f8e13fc3a251328f69f54b4d4
Reviewed-on: https://review.typo3.org/24852
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert