add shutdown handlers for libcurl wrapper