Handle write failures in hwc broadcast loop

Bug: b/154745183
Test: n/a

(cherry picked from commit 6c1c24c89faa66b8f606755933ffbc36622cbc4f)

Change-Id: I1ae3067989b76be40f40a6a56a295d59f73eefe7
diff --git a/guest/hals/hwcomposer/cutf_cvm/vsocket_screen_view.cpp b/guest/hals/hwcomposer/cutf_cvm/vsocket_screen_view.cpp
index b67544c..16185b5 100644
--- a/guest/hals/hwcomposer/cutf_cvm/vsocket_screen_view.cpp
+++ b/guest/hals/hwcomposer/cutf_cvm/vsocket_screen_view.cpp
@@ -106,6 +106,10 @@
     auto buff = static_cast<char*>(GetBuffer(current_offset));
     while (size > 0) {
       auto written = screen_server_->Write(buff, size);
+      if (written == -1) {
+        ALOGE("Broadcaster thread failed to write frame: %s", strerror(errno));
+        break;
+      }
       size -= written;
       buff += written;
     }