(xs64bit) CA-134784: Fix race conditions in refcounter