cleaning the renderer state in the GL thread safely