Prevent circular refs using idle and timeout manager when running

If an IdleManager or TimeoutManager had been scheduled, it would not get
destroyed until it was executed by the main loop, causing criticals
if the objects enclosed by its callback had been destroyed.

This adds a weak reference to the manager object itself when scheduling
on the main loop, so it can get safely dropped.
8 jobs for wip/weak-refs-for-callback-managers in 14 minutes and 8 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #218845
fedora

00:03:02

passed #218853
ubuntu

00:02:39

failed #218846
ubuntu

00:07:00

 
  Test
passed #218847
deb-package

00:03:10

passed #218878
flatpak

00:04:31

failed #218848
flatpak

00:06:13

 
  Deploy
passed #218849
review

00:00:24

passed #218850
allowed to fail manual
stop_review

00:00:19