Calling thread_stop() before free-ing conn