[BUGFIX] Only valid package names will be processed.

To prevent the extension manager from further steps while
invalid package keys exists in the system, the package keys are
validated earlier.

This prevents further actions that will lead to rewrite
of PackageState.php and invalid opcode cache.

Change-Id: Ib8d9f25dc1d6c97b94a59b15255b96d5a1960093
Resolves: #56532
Releases: 6.2
Reviewed-on: https://review.typo3.org/28286
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter