We need to validate some structs exist before we dirty the states, and avoid the problem in some other places. Fixes: e027935a ("st/mesa: don't update unrelated states in non-draw calls such as Clear") (cherry picked from commit cc69f238)