avcodec/cbs_av1: keep separate reference frame state for reading and writing