- separate cleanly between async scheduling and file IO related issues.
- make the API compatible with other types of async requests (e.g. for
  sockets).
- remove exports of async IO related functions for DLL separation.

diff --git a/server/thread.c b/server/thread.c
index 7e019fa..a43db32 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -959,8 +959,9 @@
         }
         /* Optimization: ignore APCs that have a NULL func; they are only used
          * to wake up a thread, but since we got here the thread woke up already.
+         * Exception: for APC_ASYNC_IO, func == NULL is legal.
          */
-        if (apc->func) break;
+        if (apc->func || apc->type == APC_ASYNC_IO) break;
         free( apc );
     }
     size = apc->nb_args * sizeof(apc->args[0]);