Add support for other ways of triggering intermediate result outputs

Fio has support for using the USR1 signal to dump the current
results while continuing to run. Add a --status-interval parameter
to allow this to be configured to automatically happen every X
seconds.

There's also support for signaling fio through the file system. To
do that, simply touch /tmp/fio-dump-status. When fio sees this file,
it will unlink and dump the current results.

A small tweak is needed for the file approach to work in Windows.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/backend.c b/backend.c
index f48b43d..4d4e8ef 100644
--- a/backend.c
+++ b/backend.c
@@ -1558,6 +1558,12 @@
 		fio_terminate_threads(TERMINATE_ALL);
 }
 
+static void do_usleep(unsigned int usecs)
+{
+	check_for_running_stats();
+	usleep(usecs);
+}
+
 /*
  * Main function for kicking off and reaping jobs, as needed.
  */
@@ -1736,7 +1742,7 @@
 			if (mtime_since_now(&this_start) > JOB_START_TIMEOUT)
 				break;
 
-			usleep(100000);
+			do_usleep(100000);
 
 			for (i = 0; i < this_jobs; i++) {
 				td = map[i];
@@ -1788,12 +1794,12 @@
 		reap_threads(&nr_running, &t_rate, &m_rate);
 
 		if (todo)
-			usleep(100000);
+			do_usleep(100000);
 	}
 
 	while (nr_running) {
 		reap_threads(&nr_running, &t_rate, &m_rate);
-		usleep(10000);
+		do_usleep(10000);
 	}
 
 	fio_idle_prof_stop();