core: use compare and swap in ring

Link: https://github.com/GeneAssembly/biosal/issues/763
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>