fast-import: use write_idx_file() instead of custom code