Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,
f40d753718c72693c5f520f0d9899f6e50395e94,
96555a96d724016e13190b28cffa3bc929ac60dc and
3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile.

Solution: Avoid the conflict entirely by renaming the functions and the
file. Revert the previous hacks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 8bb3d10..68cbec8 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -22,7 +22,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "sys-queue.h"
+#include "qemu-queue.h"
 #include "osdep.h"
 #include "qemu-common.h"
 #include "block_int.h"
@@ -43,7 +43,7 @@
     int ev_signo;
     off_t aio_offset;
 
-    TAILQ_ENTRY(qemu_paiocb) node;
+    QTAILQ_ENTRY(qemu_paiocb) node;
     int aio_type;
     ssize_t ret;
     int active;
@@ -63,7 +63,7 @@
 static int max_threads = 64;
 static int cur_threads = 0;
 static int idle_threads = 0;
-static TAILQ_HEAD(, qemu_paiocb) request_list;
+static QTAILQ_HEAD(, qemu_paiocb) request_list;
 
 #ifdef CONFIG_PREADV
 static int preadv_present = 1;
@@ -321,16 +321,16 @@
 
         mutex_lock(&lock);
 
-        while (TAILQ_EMPTY(&request_list) &&
+        while (QTAILQ_EMPTY(&request_list) &&
                !(ret == ETIMEDOUT)) {
             ret = cond_timedwait(&cond, &lock, &ts);
         }
 
-        if (TAILQ_EMPTY(&request_list))
+        if (QTAILQ_EMPTY(&request_list))
             break;
 
-        aiocb = TAILQ_FIRST(&request_list);
-        TAILQ_REMOVE(&request_list, aiocb, node);
+        aiocb = QTAILQ_FIRST(&request_list);
+        QTAILQ_REMOVE(&request_list, aiocb, node);
         aiocb->active = 1;
         idle_threads--;
         mutex_unlock(&lock);
@@ -381,7 +381,7 @@
     mutex_lock(&lock);
     if (idle_threads == 0 && cur_threads < max_threads)
         spawn_thread();
-    TAILQ_INSERT_TAIL(&request_list, aiocb, node);
+    QTAILQ_INSERT_TAIL(&request_list, aiocb, node);
     mutex_unlock(&lock);
     cond_signal(&cond);
 }
@@ -509,7 +509,7 @@
 
     mutex_lock(&lock);
     if (!acb->active) {
-        TAILQ_REMOVE(&request_list, acb, node);
+        QTAILQ_REMOVE(&request_list, acb, node);
         acb->ret = -ECANCELED;
     } else if (acb->ret == -EINPROGRESS) {
         active = 1;
@@ -619,7 +619,7 @@
     if (ret)
         die2(ret, "pthread_attr_setdetachstate");
 
-    TAILQ_INIT(&request_list);
+    QTAILQ_INIT(&request_list);
 
     posix_aio_state = s;