Add checks to avoid errors when ctrl-c in wizard.

Check that systray exists, not the case during first run.
Cleanup reactor stop code.

Closes #5559.
Merge remote-tracking branch 'refs/remotes/ivan/bug/5559_avoid-errors-when-ctrl-c-wizard' into develop