wgl: fix failing wglMakeCurrent
On Windows 10 with WGL, the OpenGL code was asserting on stop() because of GL_INVALID_OPERATION. It was coming from MakeCurrent failing to make the wgl context current.
When MakeCurrent fails, there was not much information. Since it can fails in location where we want to release OpenGL resources, it was hard to track it down to a wgl failure.
In case of failure, this patchset details the last error message available.
Then, it introduces a method to ensure thread-safety properties fixing the error.
Edited by Alexandre Janniaux