Fix bug from garbage cleanup of textures while optimizing GetTexture, be more careful about GL state.