VS2013 and cURL init updates

Fixed a few warnings
Added missing includes for VS2013
Cleanup curl init/cleanup

A big change was the handling of curl_global_init, curl_easy_init, curl_easy_cleanup, and curl_global_cleanup. There was potential for various errors to cause one of these to not be called resulting in a memory leak. Also, there was the potential to call curl_global_cleanup without calling curl_global_init whcih may result in a mismatch of the calls.
can you keep the indent spacing here consistent with the rest of the code please?