http_client: replaced use of ML::cmp_xchg with std::atomic_compare_exchange_weak