Check if shader uses light uniform buffer before binding

Fixes an OpenGL error casued by a shader not specifying a
uniform block called "Lights".
Apply new window size on change
Do not make render context current when adding a shared context

This function is called from the thread that uses the shared context
and should not touch the rendering context.
Set window properties before creating window

Fixes invalid enum error
Fix some OpenGL issues

* Request flushing OpenGL pipeline after loading mesh buffers.
  This has to be done or the buffers might never be filled properly.

* Create renderer after window to ensure that renderer always has a
  valid viewport set.