glthread: sync in glFlush for multiple contexts