[Core] Fix crash in msbuild console logger

The console logger expects start/finish events to be delivered by msbuild in
the correct order, and crashes if it does not. I added checks to prevent the
crash since looks like in some cases (e.g. if msbuild crashes) some finish
events are not properly sent. 

This fixes bug 23184 - On running PCL/Shared Android application in
RELEASE mode it gives "MSBuild failure" error.