makes sure to sync db on complete rescan, to better handle a crash (while the db is basically in read-only mode)