soup: fix start/stop race in souphttpclientsink
Fix crash or hang in generic/states unit test when doing stop() right after start(). Create main loop in the start function already and not just in the thread function, so that stop() always has a valid main loop to quit on. Also, calling g_main_loop_quit() before g_main_loop_run() won't work and result in the stop function waiting for the thread to join forever. Therefore, wait for the thread to be ready and get the main loop running in the start() function, to be sure stop() always works.
Showing with 31 additions and 1 deletion