rdma engine graceful teardown

For rdma ioengine's one side operation, RDMA_WRITE or RDMA_READ,
server side gets a message from client side that the task is finished.
In previous version, the server simply exit() in td_io_commit() which
causes segmentation fault in thread mode or process hanging in process
mode. This patch achieves graceful tear down by setting up `td->done`
as UDP engine did.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/ioengines.c b/ioengines.c
index 1a0898d..bb7833f 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -208,6 +208,16 @@
 {
 	int r = 0;
 
+	/*
+	 * For ioengine=rdma one side operation RDMA_WRITE or RDMA_READ,
+	 * server side gets a message from the client
+	 * side that the task is finished, and
+	 * td->done is set to 1 after td_io_commit(). In this case,
+	 * there is no need to reap complete event in server side.
+	 */
+	if (td->done)
+		return 0;
+
 	if (min > 0 && td->io_ops->commit) {
 		r = td->io_ops->commit(td);
 		if (r < 0)