[BUGFIX] Cannot uninstall packages with dependencies in install tool

Scenario:
* upgrading from Introcuction Package with TYPO3 CMS 6.2
  to TYPO3 CMS 7
* realurl is marked as incompatible extension to be uninstalled
* realurl is a dependency of bootstrap_package which itself is
  dependency of introduction

Result:
* resolving the dependencies does not work and thus the uninstall
  process for realurl fails as well

Solution:
* check whether extension to be removed is a dependency of some
  other extension
* if so, first remove that extension and afterwards to original
  extension

Resolves: #63526
Releases: master
Change-Id: Ie2bbfc1d46f338c42d557ec6d103b7766317cf75
Reviewed-on: http://review.typo3.org/34946
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Oliver Hader <oliver.hader@typo3.org>