all: check return value from daemon() call

* */*main.c: (main) Current versions of Gcc warn if the return value for
  daemon() is not checked.  So add a simple test and exit on failure.

diff --git a/tests/main.c b/tests/main.c
index edc3b2d..e0fbb4d 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -174,8 +174,11 @@
   sort_node ();
 
   /* Change to the daemon program. */
-  if (daemon_mode)
-    daemon (0, 0);
+  if (daemon_mode && daemon (0, 0) < 0)
+    {
+      fprintf(stderr, "daemon failed: %s", strerror(errno));
+      exit (1);
+    }
 
   /* Create VTY socket */
   vty_serv_sock (vty_addr, vty_port, "/tmp/.heavy.sock");