EGL surface and context management fixes

One cleanup and two fixes; one use-after free, and another state tracking fix. See individual commits.

Merge request reports

Loading