(backport) OpenGl fixes:

Merged Julien Wadel requested to merge fix/opengl_master into master
  • Load only local libraries to avoid conflicts or unwanted external libraries.
  • Remove empty logs from link/program.
  • Leak and crash: Destroy context and fix MakeCurrent on threads.
  • Fix crash when no display.
  • Fix having no preview window with Auto display (preview_window_id is 0).
  • Fix mac filter to use a window when changing window mode to auto.

Merge request reports