Fix gtk glitches when error is triggered in run_command()

If the popup window is not hidden before opening the
error window, then it causes overlapped windows in gtk3
and broken grab in gtk2.