Add code to detect a task that exited prior to up'ing the startup mutex

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.c b/fio.c
index 63d9a1b..fa5deab 100644
--- a/fio.c
+++ b/fio.c
@@ -1492,7 +1492,13 @@
 					*fio_debug_jobp = pid;
 			}
 			dprint(FD_MUTEX, "wait on startup_mutex\n");
-			fio_mutex_down(startup_mutex);
+			if (fio_mutex_down_timeout(startup_mutex, 10)) {
+				log_err("fio: job startup hung? exiting.\n");
+				terminate_threads(TERMINATE_ALL);
+				fio_abort = 1;
+				nr_started--;
+				break;
+			}
 			dprint(FD_MUTEX, "done waiting on startup_mutex\n");
 		}