[powerdebug 18/23] make the mainloop immune against the signals