[BUGFIX] Use file name to check extension validity

Instead of using a file's identifier, the file's name is used
to check if it has a valid file extension.

This allows FAL drivers to use non-file name related identifiers.

Change-Id: I5b870e06f60c9259951a5f20fd69660ab19c49c2
Resolves: #57141
Releases: 6.2
Reviewed-on: https://review.typo3.org/28597
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Markus Klein
Tested-by: Markus Klein