Add build check result errors into the list of build submission IDs that have logged error
Fixes #10071
Context
While building with buildcheck enabled and MSBUILDNOINPROCNODE=1
Severity of the rule set to Error, does not reported to the all build:
This is since buildcheck error is not added into the _warningsAsErrorsByProject, WarningsAsErrors == null && _warningsAsErrorsByProject == null is true all the time. so HasBuildSubmissionLoggedErrors always return false.
https://github.com/dotnet/msbuild/blob/843bfa584a08401b30e4c0b21a3c0b534568877e/src/Build/BackEnd/Components/Logging/LoggingService.cs#L578-L586
Changes Made
when buildEventArgs is BuildErrorEventArgs, treat BuildErrorEventArgs' related warnings as errors
Testing
Notes
Will add a test after figured out the reason of flaky test SampleAnalyzerIntegrationTest https://github.com/dotnet/msbuild/issues/10036