[BUGFIX] PackageManager fails on empty and non-extension dirs

Check if the could-be extension has an ext_emconf.php file.

Resolves: #52754
Releases: 6.2
Change-Id: I39f0da5d108ce38e3f401c64b82e1bb810b4437b
Reviewed-on: https://review.typo3.org/24701
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Markus Klein
Tested-by: Markus Klein