Changed destruction order of CURL handle