Fix guard on encode_map_entry for flag types.