Fix threadsafe issue in HTTP client, ENG-5438