Fixed threading issues of threaded_http