Fixes for issues reported by Coverity (VPP-972)

Change-Id: I25238debb7081b4467aec4620dfdef33fbef3295
Signed-off-by: Chris Luke <chrisy@flirble.org>
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index c90e133..3a92b2e 100644
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -434,6 +434,10 @@
 				  vlib_default_runtime_dir, 0);
     }
 
+  error = setup_signal_handlers (um);
+  if (error)
+    return error;
+
   if (um->pidfile)
     {
       if ((error = vlib_unix_validate_runtime_file (um,
@@ -448,10 +452,6 @@
 	}
     }
 
-  error = setup_signal_handlers (um);
-  if (error)
-    return error;
-
   if (!(um->flags & UNIX_FLAG_INTERACTIVE))
     {
       openlog (vm->name, LOG_CONS | LOG_PERROR | LOG_PID, LOG_DAEMON);