Don't queue a query if it is directly rejected

Otherwise we'll wedge the desktop object which expects an approval
or rejection to eventually show up.
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 2131db6..dd1d4ca 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -306,6 +306,12 @@
     return rfb::VNCServerST::REJECT;
   }
 
+  count = vncNotifyQueryConnect();
+  if (count == 0) {
+    *reason = strDup("Unable to query the local user to accept the connection.");
+    return rfb::VNCServerST::REJECT;
+  }
+
   queryConnectAddress.replaceBuf(sock->getPeerAddress());
   if (!userName)
     userName = "(anonymous)";
@@ -313,12 +319,6 @@
   queryConnectId = (uint32_t)(intptr_t)sock;
   queryConnectSocket = sock;
 
-  count = vncNotifyQueryConnect();
-  if (count == 0) {
-    *reason = strDup("Unable to query the local user to accept the connection.");
-    return rfb::VNCServerST::REJECT;
-  }
-
   return rfb::VNCServerST::PENDING;
 }