Change httpclient adapter to use thread local variables for thread safety