Check the return value of the worker threads.

sync_enc_workers() should check the return value of the
winterface->sync(worker) calls. If any of them returns false, then there
was an error, and sync_enc_workers() should call aom_internal_error().

BUG=aomedia:2010

Change-Id: Ia1870d20ad4ff301a5681a8405056fc034e10b98
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 96afa36..c0a3eea 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -455,12 +455,17 @@
 
 static void sync_enc_workers(AV1_COMP *cpi, int num_workers) {
   const AVxWorkerInterface *const winterface = aom_get_worker_interface();
+  int had_error = 0;
 
   // Encoding ends.
   for (int i = 0; i < num_workers; i++) {
     AVxWorker *const worker = &cpi->workers[i];
-    winterface->sync(worker);
+    had_error |= !winterface->sync(worker);
   }
+
+  if (had_error)
+    aom_internal_error(&cpi->common.error, AOM_CODEC_ERROR,
+                       "Failed to encode tile data");
 }
 
 static void accumulate_counters_enc_workers(AV1_COMP *cpi, int num_workers) {