Fix newline and encoding handling for nuspec and definition files

 - Fix empty nuspec files being generated on Windows
 - Fix newline inconsistency in when synchronising definition files