tools: Ensure that ndn-autoconfig quits after successful discovery in non-daemon mode

Change-Id: Ifde24e1800faba630cafb7b04d034b916a6c069d
Refs: #2469
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index 01ac6a7..f7eb5db 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -95,9 +95,11 @@
   void
   run()
   {
-    m_terminationSignalSet.add(SIGINT);
-    m_terminationSignalSet.add(SIGTERM);
-    m_terminationSignalSet.async_wait(bind(&NdnAutoconfig::terminate, this, _1, _2));
+    if (m_isDaemonMode) {
+      m_terminationSignalSet.add(SIGINT);
+      m_terminationSignalSet.add(SIGTERM);
+      m_terminationSignalSet.async_wait(bind(&NdnAutoconfig::terminate, this, _1, _2));
+    }
 
     m_io.run();
   }