[BUGFIX] Ignore dependencies of inactive packages

It might happen that activating or deactivating
a package throws an exception because other inactive
packages are available on the system with broken or
not fulfilled dependencies.

To solve this issue, only active packages
are regarded when resolving dependencies.

To remove a side effect from this change,
cache clearing in extension manager is
moved to a later point (see #54951).

This needs a proper fix in another change,
but makes this fix work for now.

Resolves: #54879
Releases: 6.2
Change-Id: Id81b66b2d2b6f4ba7d1c6ea2d001c271982539b3
Reviewed-on: https://review.typo3.org/26719
Reviewed-by: Thomas Maroschik
Reviewed-by: Markus Klein
Tested-by: Kasper Ligaard
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader