delete GL resources only when the Gl thread is current. Fixes #12