Fix for the next(int) function in AtomicQueue.

The calculation now uses remainder instead of bitwise AND.
Merge pull request #541 from envy3d/master

Fix for the next(int) function in AtomicQueue.