[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/19675
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn