pack-write: use hashwrite_be32() in write_idx_file()