platform2: change smart battery metric retrieval

Change cros_healthd_tool in debugd to use ProcessWithOutput
instead of trying to reinvent the wheel. Make the corresponding
changes to cros_healthd to use the new D-Bus interface, which
returns a string instead of a file descriptor. Add more test
coverage to cros_healthd.

BUG=chromium:1035138
TEST=build and deploy debugd, debugd-client, diagnostics to
nami and run 'telem --category=battery'. Make sure the
smart metrics are nonzero. Also run diagnostics unit tests.

Change-Id: I3b5707ccefd348d734b75e0d815ed7127d2e4763
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2002959
Tested-by: Paul Moy <pmoy@chromium.org>
Commit-Queue: Paul Moy <pmoy@chromium.org>
Reviewed-by: Kartik Hegde <khegde@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/debugd/src/process_with_output.cc b/debugd/src/process_with_output.cc
index 66b9d77..0648e21 100644
--- a/debugd/src/process_with_output.cc
+++ b/debugd/src/process_with_output.cc
@@ -40,8 +40,13 @@
 }
 
 bool ProcessWithOutput::Init() {
+  return Init({});
+}
+
+bool ProcessWithOutput::Init(
+    const std::vector<std::string>& minijail_extra_args) {
   if (use_minijail_) {
-    if (!SandboxedProcess::Init())
+    if (!SandboxedProcess::Init(minijail_extra_args))
       return false;
   }