h264: tighten the valid range for ref_frame_count