Use g_cond_wait_until() instead of g_cond_timed_wait()