issue #2305: Reverting to use lock and unlock for HttpClient.