[BUGFIX] Avoid sql error in after-save-hook in combination with FAL

Resolves: #52661
Change-Id: I3903a5e9be5edc9926db5101281f3b76f95e52d6
Reviewed-on: https://review.typo3.org/31093
Reviewed-by: Armin Ruediger Vieweg
Tested-by: Armin Ruediger Vieweg