Add log_info_flush()

If fio dumps status through -USR1 or similar and output is
being stored in a file, the buffering on the file descriptor
by the library can cause is not to see all the output. Ensure
that it gets flushed after dumping stats.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Ensure that stat outputs are serialized

Two issues:

- We don't want potentially two stat outputs running at the same time.
  This could potentially happen if USR1 or interval stats race with
  the thread exit.

- We could potentially crash if the interval or USR1 signaled stat
  output trigger when fio is tearing down. Let the main thread wait
  for any in-progress output in that case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>