lib/curl: add support for setting the user agent