[BUGFIX] No exception if uninstalled extension has an invalid key

The loop that scans for packages should skip those whose key is not
valid, in order to avoid an exception later down the road.

Resolves: #52779
Releases: 6.2
Change-Id: Ic9903b7d69fd6c9b9581e85d2f6ea1222ebb8885
Reviewed-on: https://review.typo3.org/24728
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik