use a mask instead of module in ring

Before: 0m28.183s
After: 0m28.882s

Link: https://github.com/nitsanw/examples/blob/master/src/java/uk/co/real_logic/queues/P1C1QueueOriginal2.java
Link: http://psy-lob-saw.blogspot.com/2013/03/single-producerconsumer-lock-free-queue.html
Link: https://github.com/GeneAssembly/biosal/issues/314
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>