Make dbus handle threads and flush queue on exit.

This fixes the long latency on command dispatchs because doing lock-unlock
with no actual time in unlocked state does not guarantee progress for other
threads.