pub fn atomic_write(path: &Path, bytes: &[u8]) -> Result<()>
Atomically write bytes to a file (write to temp, then rename).