Safety fix: clear "_this->current_glwin" when destroying the window (cherry picked from commit 0c048d98af449f1bc540e256c90eb792f1effff4)