[Core] Fix a null reference exception handling MSBuild errors

It is common for the 'File' property to be null, so don't try
to use it when it's null.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18309
Merge pull request #499 from mono/fix_msbuild_integration

[Core] Fix a null reference exception handling MSBuild errors