reset stale curl options before setting new ones

Fixes strange behaviors when reusing the curl handle for multiple requests.

For example, the first request might set data (e.g., CURLOPT_POSTFIELDS).  When the second request is made, if it does not also set data - like ant GET request - the stale data will be sent to the server, resulting in various problems.