Move a little more code inside #if HAVE_LIBCURL