[BUGFIX] Persist files that are updated in ResourceStorage

When renaming or moving folders all files in that
folder needs to be updated. ResourceStorage handles
that, but the changes to the properties are not
persisted, which leads to inconsistent file records.

Persist updated files using the FileRepository and
clean up the code a bit.

Fixes: #44439
Releases: 6.0, 6.1

Change-Id: I9a21040fdd6741e030d812df165cd33959dd8db1
Reviewed-on: https://review.typo3.org/17478
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel