Shut down the gearman server last in tests

In particular, shut it down after all its clients have been shut
down.  In some cases, it was shut down early enough that the RPC
listener was able to attempt to reconnect to it and trigger a
rare condition in gear that would cause the reconnection thread
to hang.

Change-Id: I1dc5d77484eabf9fa43f16ae8295ddb4df4af056
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 4a4d6de..0399ca5 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -896,7 +896,6 @@
         self.merge_server.join()
         self.merge_client.stop()
         self.worker.shutdown()
-        self.gearman_server.shutdown()
         self.gerrit.stop()
         self.timer.stop()
         self.sched.stop()
@@ -907,6 +906,7 @@
         self.webapp.join()
         self.rpc.stop()
         self.rpc.join()
+        self.gearman_server.shutdown()
         threads = threading.enumerate()
         if len(threads) > 1:
             self.log.error("More than one thread is running: %s" % threads)