Synchronize the database when working with the `File` or `Folder` class (see #4991)