Fix infinite loop when a failing test ends
Fix infinite loop when a failing test ends

When a test fails, the call to `bus.poll` in `save_frame` never returns
(in spite of the timeout parameter).

The culprit was the call to gtk.gdk.threads_init() which we added in
3811764 to avoid a segfault in the queue's `underrun` signal handler.
This initialises gdk threads as well as any glib threads. Calling
glib.threads_init() instead, fixes this problem. I don't really
understand why and I hope it isn't just a race condition whose timing
has been shifted slightly.

Note that version of the glib python module on Scientific Linux 6
(pygobject 2.20.0) doesn't have `threads_init`, but the gobject module
does. These two modules are essentially the same thing, and using
gobject.{thread_init,add_timeout,source_remove} (instead of the same
functions in glib) works on SL6 and Fedora 17 (pygobject 2.28.6).

LewisHaley/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,wmanley/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester,stb-tester/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester