Fix crash in release_texture() called in frame destructor.

The "close glsl" event handler would destroy the texture container
objects while lingering frames still held references to them.