using local copy of a handle inside of the CURLOPT_HEADERFUNCTION callback