Lock every access to the GL API when the renderer is paused.

When the application was paused during the loading of a level, pausing the
rendering thread did not avoid creating new textures. These textures were
invalid when the application was activated, forcing us to restore all the
textures.

With the new lock, no invalid textures are created and we can avoid the
restoration.