Fix crash on linux using SwapBuffer w/o context.