Add support for a shutdown call from the admin interface

Make sure we clean up properly and close connections.

Change-Id: Iec3fede61615d4f9e4a5561006c182e7785c1977
diff --git a/util.py b/util.py
index a35d24c..1e246fc 100644
--- a/util.py
+++ b/util.py
@@ -101,6 +101,10 @@
                 ret['uptime'] = time.time() - state.starttime
             elif command == 'daemon.probe_switches':
                 ret = self.probe_switches(state)
+            elif command == 'daemon.shutdown':
+                # data ignored
+                ret['shutdown'] = 'Shutting down'
+                state.running = False
             else:
                 raise InputError("Unknown daemon_query command \"%s\"" % command)