pub fn write(root: &Path, lock: &LockFile) -> Result<(), MarsError>
Write the lock file atomically to the given root directory (always v2 format).