Avoid crash when QOpenGLContext is destroyed before the VAO

Change-Id: I19df59453156a95c5075a065268333a74cec2476
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>