Support to stop the watchdog

Check the request flags for the set watchdog command to determine
if the watchdog needs to be stopped or restarted.
diff --git a/apphandler.C b/apphandler.C
index 9d53552..45cec19 100755
--- a/apphandler.C
+++ b/apphandler.C
@@ -134,8 +134,8 @@
         return -1;
     }
 
-    // Start watchdog
-    r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"start");
+    // Stop the current watchdog if any
+    r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"stop");
     if (r < 0) {
         fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r));
         return -1;
@@ -146,6 +146,21 @@
         return -1;
     }
 
+    // Start the watchdog if requested
+    if (reqptr->t_use & 0x40)
+    {
+        r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"start");
+        if (r < 0) {
+            fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r));
+            return -1;
+        }
+        r = sd_bus_call(bus, m, 0, &error, &reply);
+        if (r < 0) {
+            fprintf(stderr, "Failed to call the start method: %s\n", strerror(-r));
+            return -1;
+        }
+    }
+
     sd_bus_error_free(&error);
     sd_bus_message_unref(m);