Fix Issue 11865 - Unhandled exception does not show crash dialog

https://d.puremagic.com/issues/show_bug.cgi?id=11865

If a console window is not present, display uncaught exceptions in a standard Windows message box.