Fix overwriting of files when applying contextually independent diffs