Extract DBus/Gtk thread stuff from AppIndicator to a new static class so that it can be shared by other plugins.