Tries to use Gtk.Application.inhibit() and friends instead of calling directly into dbus; closes #5903.