Host UI errors (dotnet/core-setup#4844)
Implements reporting errors with message box for Windows GUI apps in apphost.
In apphost, if it's running as GUI, error writing will be redirected to a buffer. Upon exit, if the error buffer is not empty, it will be showed on screen as a message box.
The error writer is propagated from apphost to hostfxr and thus to hostpolicy.
This solves the problem that GUI apps which don't have console die silently without reporting any errors if there are issues during host execution.
Commit migrated from https://github.com/dotnet/core-setup/commit/
c90e8d7ee0ad11b9ac23967dad606afb2f86acaf