fsync file writes

This change ensures that all file writes are fsync'd.  This is in an
attempt to address some issues we're seeing with corrupted files
shortly after they are written.

[#58149152]
Merge 58149152-fsync to master

[Completes #58149152]