Have an actual fallback if the surface is lost

Bug: 17516789

This will force a relayout/reinitialize pass if the Surface
is lost mid-render instead of crashing on the next frame

Change-Id: If08bfa16f740728fa7c05904fa11e26f07b81e2e
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index b499dd0..6c3637d 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -166,6 +166,11 @@
         freePrefetechedLayers();
     }
 
+    if (CC_UNLIKELY(!mNativeWindow.get())) {
+        info.out.canDrawThisFrame = false;
+        return;
+    }
+
     int runningBehind = 0;
     // TODO: This query is moderately expensive, investigate adding some sort
     // of fast-path based off when we last called eglSwapBuffers() as well as