ilo: correctly check for stencil ref change