agent: Fix sporadic crash when test-dbusjson finishes

Allow the DBus worker thread to properly cleanup all of its
own nastiness in the mainloop before bringing down the GTestDBus
bus.

GDBus is a can of worms with regard to cleanup. This is another
workaround.