[BUGFIX] Fix StorageRepository::findByStorageType

Since optimizing the retrieval of Storages the
findByStorageType() doesn't find any (also right ones)
storage, because of a wrong comparison.
This fixes also the localDriverStorageCache in
ResourceFactory, finding a bestMatchingStorageByLocalPath
in ResourceFactory, getting the right storage for a local
path as fileIdentifier and creation of duplicate entries 
in sys_file with storage 0.

Resolves: #56400
Releases: 6.2
Change-Id: I75ac357dff498f1a209d4c42896bdeddab3641ad
Reviewed-on: https://review.typo3.org/27915
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel