[BUGFIX] Get folder object if a path is given

Get folder instead file object if a path is given to FAL.

Change-Id: I6d183d319eacbab403079b126685a13eb3ae7d5c
Resolves: #45748
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/18690
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring