[core] Fail to initialize opengl thunk if no open window.
[core shell vis] Fix calling opengl functions before window is open.