Fixing CurlAdapter memory leak. Closes #813