Backport "gdbusconnection: Fix test signal subscription ordering" to glib-2-80
The test case assumes signals will dispatched in a different order than they're subscribed. In fact, signals can be dispatched in any order, and are often dispatched in order.
This commit reorders the subscriptions so they're in order, which is more logical, and also changes the code to only exit the event loops when there are no pending handlers ready to dispatch.
(cherry picked from commit 47866d25)