Updated fsync handling to fall back to os.fsync if neither os.fdatasync or fcntl.F_FULLFSYNC are available