lockfree: rework the use of weak and strong compare_exchange