Fix for the next(int) function in AtomicQueue.

The calculation now uses remainder instead of bitwise AND.

The associated bug is [Issue 1630](https://code.google.com/p/libgdx/issues/detail?id=1630).