Tidy up GL resources

Currently it's not safe to destroy and recreate RenderEngine because
certain GL resources are persisted in GLESRenderEngine, which is
imposing limitations on testing. This patch adds some cleanup steps,
including:
* Supporting destruction of glPrograms once they're unused.
* Purging the ProgramCache of shaders when RenderEngine is destroyed
* Tidy up Framebuffer destruction when backed by an EGLImage
* Make sure shadow resources are destroyed prior to display termination
* Disable vertex attribute used for positioning layers.
* Check that EGL objects are valid before display termination.

Bug: 173416417
Test: librenderengine_test, and observe logcat
Change-Id: Id5d858d21a400ef170788d917f0bc0ac5e318bdc
diff --git a/libs/renderengine/gl/Program.h b/libs/renderengine/gl/Program.h
index 4292645..41f1bf8 100644
--- a/libs/renderengine/gl/Program.h
+++ b/libs/renderengine/gl/Program.h
@@ -54,7 +54,7 @@
     };
 
     Program(const ProgramCache::Key& needs, const char* vertex, const char* fragment);
-    ~Program() = default;
+    ~Program();
 
     /* whether this object is usable */
     bool isValid() const;