fix 'monitor' mainloop on shutdown