counters: use compiler intrinsic for memory barrier.