window: Work on GL context, fix cleanup