Use `os.fsync` in order to sync the reboot sentinel file to disk before reboot to avoid calling `sync` via shell.