intset: optimize group varint encoding

This removes some branches and allocations.

Similar to the decoding speeds, the encoder optimizations only show up
if there are lots of different sized integers being encoded to mess
with the branch prediction.