gfio: update for handling files, connections, states

Big update, changes:

- Notify from client helpers when a client is removed. This helps
  gfio track this.

- Make the connection states more bullet proof. You can now connect
  and disconnect, and expect connect to work again.

- Limit number of files opened through file selection or drag'n drop
  to just 1.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/client.c b/client.c
index 86ac8f4..4037269 100644
--- a/client.c
+++ b/client.c
@@ -134,6 +134,9 @@
 	close(client->fd);
 	client->fd = -1;
 
+	if (client->ops->removed)
+		client->ops->removed(client);
+
 	nr_clients--;
 	sum_stat_clients--;
 
@@ -374,9 +377,9 @@
 	return 0;
 }
 
-void fio_client_terminate(struct fio_client *client)
+int fio_client_terminate(struct fio_client *client)
 {
-	fio_net_send_quit(client->fd);
+	return fio_net_send_quit(client->fd);
 }
 
 void fio_clients_terminate(void)