Deal with different encodings of Cargo.lock

On windows, git will check out files with different line endings causing the
same serialized resolve to be resolved slightly differently. Instead of
comparing contents, this commit alters by testing whether the decoded resolve is
equivalent to the to-be-written resolve and only aborts writing if the two are
equal.