Force sync to disk prior to renaming the file for additional safety.