Adds a closure to be called by the main loop the returned
Source is attached to when a child
func will be called when
child_watch_add(), this does not require
func to be
Send but can only be called from the thread that owns the main context.
This function panics if called from a different thread than the one that owns the main context.