r300g: fix crash in r300_is_texture_referenced