Merge "free EGL resources associated to a thread when it terminates"