rewrite tests to not rely on precise timing of timeouts
@walters
Submitted by Colin Walters Link to original bug (#700460)
Description
I saw this at least once:
GLib:ERROR:../../../glib/tests/mainloop.c:494:test_recursive_child_sources: assertion failed (a == 9): (8 == 9)
The test is "orange" though because it passed later without a source code change.