When rendering with headless builds, show an error instead of crashing. Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end. This also disables the bgl Python module when building WITH_HEADLESS.
Endless Infinite loop in Blender-thumnailing due to logical bugs.
Looks like a fix for the second issue made it into 3.2.2.