use curl_multi_wait instead of curl_multi_fdset and select