midx: add entries to write_midx_context