Destroy surfaces from Display::terminate instead of the DisplayImpl destructor.

Previously, the parent display impl would be destroyed before the surface
impls.  It is useful to call helper functions in the parent display during
surface destruction.

BUG=540829

Change-Id: I0884826d2e360319da896f049d46bfc01a2481a0
Reviewed-on: https://chromium-review.googlesource.com/316801
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/DisplayImpl.cpp b/src/libANGLE/renderer/DisplayImpl.cpp
index 2eb44eb..8061189 100644
--- a/src/libANGLE/renderer/DisplayImpl.cpp
+++ b/src/libANGLE/renderer/DisplayImpl.cpp
@@ -21,10 +21,7 @@
 
 DisplayImpl::~DisplayImpl()
 {
-    while (!mSurfaceSet.empty())
-    {
-        destroySurface(*mSurfaceSet.begin());
-    }
+    ASSERT(mSurfaceSet.empty());
 }
 
 void DisplayImpl::destroySurface(egl::Surface *surface)