Ensure that we have no IO pending when sleeping

For rate limiting or thinktime handling, ensure that we have
no busy IO when we do spin or sleep. Otherwise we potentially
skew the latencies a lot, since events could have been reaped.

Already working for rate iops, just abstracted it out and
ensure that we do the same for thinktime. Only a problem for
certain workloads, those with queuedepth > 1.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/backend.c b/backend.c
index 89ffee1..6b6da67 100644
--- a/backend.c
+++ b/backend.c
@@ -822,6 +822,8 @@
 			if (!(b % td->o.thinktime_blocks)) {
 				int left;
 
+				io_u_quiesce(td);
+
 				if (td->o.thinktime_spin)
 					usec_spin(td->o.thinktime_spin);