It might be a good idea to reset the on_shutdown list before the source wakes up. That way we avoid that handlers get accumulated from one wakeup/sleep cycle to the next. This will of course rarely happen but it's perfectly doable with dynamic stuff.