Initialize multi-thread workers

When multi-threading is on, we could always initialize these workers
and associated memory.

BUG=aomedia:3491

Change-Id: Ifef1f243381e1899537eceb818e5a82529b4fbf9
(cherry picked from commit fcfdc09d81b122cd5e70f66dc55833065127bf47)
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 2ba7de5..182a098 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -3102,7 +3102,9 @@
       }
       av1_create_workers(ppi, num_workers);
       av1_init_tile_thread_data(ppi, cpi->oxcf.pass == AOM_RC_FIRST_PASS);
+    }
 #if CONFIG_MULTITHREAD
+    if (ppi->p_mt_info.num_workers > 1) {
       for (int i = 0; i < ppi->num_fp_contexts; i++) {
         av1_init_mt_sync(ppi->parallel_cpi[i],
                          ppi->parallel_cpi[i]->oxcf.pass == AOM_RC_FIRST_PASS);
@@ -3110,8 +3112,8 @@
       if (cpi_lap != NULL) {
         av1_init_mt_sync(cpi_lap, 1);
       }
-#endif  // CONFIG_MULTITHREAD
     }
+#endif  // CONFIG_MULTITHREAD
 
     // Re-allocate thread data if workers for encoder multi-threading stage
     // exceeds prev_num_enc_workers.