pub fn save(root: &Path, state: &State) -> Result<()>
Write a session’s loop. The write is atomic, so a reader never sees half a record.