issue #2305: Using c++11 std::thread instead of pthread for HttpClient class.
issue #2305: Fixing a crash when error is triggered in WebSocket. Using std::lock_guard to replace lock and unlock manually.
issue #2305: Reverting to use lock and unlock for HttpClient.
issue #2305: Fixing a bug that passing wrong mutex parameter to "wait".
issue #2305: Using the old logic of "wait".
issue #2305: Sleep(50) on Win32, usleep(50000) on unix --> std::this_thread::sleep_for(std::chrono::milliseconds(50));
Merge pull request #3001 from dumganhar/iss2305-std-thread

issue #2305: Using c++11 std::thread instead of pthread for HttpClient class.