Write index size instead of using 0-terminator.

This allows us to, for instance, perform binary search
on the indices, as described in the TPT paper.