Fix destruction order. Defer destroying the GL context until the

destructor so that other GL resources can be destroyed first. This
fixes crashes on some linux GPU drivers.