init: Introduce RequiresConsole()

Prepare for adding more code in the parent process that depends on
whether or not a console is required.

Bug: 213617178
Change-Id: I066ede32fcd4ce09d06be23158f3c1970064a697
Signed-off-by: Bart Van Assche <bvanassche@google.com>
diff --git a/init/service_utils.cpp b/init/service_utils.cpp
index 52e6615..16eab9e 100644
--- a/init/service_utils.cpp
+++ b/init/service_utils.cpp
@@ -240,7 +240,7 @@
         }
     }
 
-    if (!attr.console.empty()) {
+    if (RequiresConsole(attr)) {
         setsid();
         OpenConsole(attr.console);
     } else {