[CLEANUP] GeneralUtility::getFilesInDir()

Refactor getFilesInDir to use scandir().

Change-Id: Iafca3e7b7610ef0b11441ef118c85c8e6cc481b8
Resolves: #54095
Releases: 6.2
Reviewed-on: https://review.typo3.org/25768
Reviewed-by: Michiel Roos
Tested-by: Michiel Roos
Reviewed-by: Markus Klein
Tested-by: Markus Klein