Hide debug dialog on windows

When the application has an error it will no longer show a dialog in the
user interface.  This should better meet the needs of automated
simulations.

[#81138538] #4471
@kbenne So, I got what I asked for here (thanks), but it would be useful to keep the debug dialog when doing a debug build.  I tried added #ifndef NDEBUG around this block, but that did not seem to work.