reftable: fix writing multi-level indices
I noticed that it becomes impossible to seek refs in the last reftable block once we exceed a certain threshold of refs. As it turns out this was caused by broken logic that writes multi-level indices. This MR fixes this bug.
Closes #250 (closed).