(PGraphicsOpenGL) Moved the open gl thread check ahead of a call that depended on being in the correct thread