Fix problem with CURLOPT_HEADERFUNCTION

Is my solution to fix #65.

After some digging it seems that CURLOPT_HEADERFUNCTION loads a single line of header so I iterates over the raw headers as suggested in the issue.