Prevent rewriting the version file if the version has not changed

When using the Version task to auto-generate AssemblyInfo.cs or *.rc files, it will always rewrite the version file even if the version is only being read out. This results in the AssemblyInfo.cs or *.rc file always needing to be re-generated to ensure that it is in sync.
This change prevents modifying the version file when it is used read-only and enables using the version file as a target input, and the AssemblyInfo.cs or *.rc file as a target output for incremental builds.