tests/ibus-config Fix timeout_id handling

tests/ibus-config queues a timeout whose callback calls
g_main_loop_quit() before returning FALSE. After exiting the mainloop,
g_source_remove(timeout_id) is called, but if the mainloop was exited
through the timeout callback, the source will already have been removed.

This commit makes sure we only try to call g_source_remove() on that
timeout if we did not exit the mainloop through the timeout callback.

BUG=http://code.google.com/p/ibus/issues/detail?id=1712

Review URL: https://codereview.appspot.com/108730044
Patch from Christophe Fergeau <cfergeau@redhat.com>.