main: Create a helper function for "owner wakeup" optimization
main: Create a helper function for "owner wakeup" optimization

The original patch really should have introduced a helper - among
other things it deserves a code comment.  We're likely to make
further changes too, so it's obviously better to only do it in one
place.

See: https://bugzilla.gnome.org/show_bug.cgi?id=761102

johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,endlessm/glib,johne53/MB3Glib,endlessm/glib,johne53/MB3Glib,endlessm/glib,endlessm/glib,endlessm/glib