MDL-37761 Backup: Check that files exist before using a storedfile

To prevent errors in the restoration where the source file does not exist
for some reason, first check that the file described by the file id exists.

In the event that the specified file record does not exist, an attempt is
made to retrieve another file entry which has the same contenthash.

As the deduplication method is based on content hash, and each content hash
is theoretically unique, it is safe to retrieve any file described by the
content hash. All remaining metadata is provided by the backup metadata.
MDL-37761 Backup: Add support for fileless SAMESITE backups
MDL-37761 Backup: Add phpdoc for MODE constants