[Core] Fix a regression from e0cf1483 when saving csproj

If both the old value and new value are the same we should do nothing.
We should probably also be careful in case the new value is null. In
this scenario that probably means we should remove the xelement but
currently that might still trigger the bug in
https://bugzilla.xamarin.com/show_bug.cgi?id=11039