libcollections: Fix RingBuf growth for non-power-of-two capacities

See test for details.