shill: DHCPCDProxy: Make ServiceUnknown error non-fatal in Release()

The dhcpcd process can race with us to exit when an interface goes
down or at exit.  It should not be an error if we cannot reach the
daemon to release a lease if it no longer exists.  In the worst case
we will just end up holding the lease and attempt to renew it on
re-connection, which is exactly what we'd do if we crashed.

BUG=chromium-os:37073
TEST=Re-run unit tests.  Really the only good test is to watch
the crash logs and the occurrence of failures in platform_ExternalUSBStress

Change-Id: I53e4c96bdf6297ae2cf26d47b44b2d9d2c2d60d6
Reviewed-on: https://gerrit.chromium.org/gerrit/39697
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/dhcpcd_proxy.cc b/dhcpcd_proxy.cc
index bebcad5..5bf49fd 100644
--- a/dhcpcd_proxy.cc
+++ b/dhcpcd_proxy.cc
@@ -4,6 +4,9 @@
 
 #include "shill/dhcpcd_proxy.h"
 
+#include <dbus/dbus.h>
+#include <string.h>
+
 #include <limits>
 
 #include "shill/dhcp_provider.h"
@@ -114,8 +117,12 @@
   try {
     proxy_.Release(interface);
   } catch (const DBus::Error &e) {
-    LOG(FATAL) << "DBus exception: " << e.name() << ": " << e.what()
-               << " interface: " << interface;
+    if (!strcmp(e.name(), DBUS_ERROR_SERVICE_UNKNOWN)) {
+      LOG(ERROR) << "dhcpcd daemon appears to have already exited.";
+    } else {
+      LOG(FATAL) << "DBus exception: " << e.name() << ": " << e.what()
+                 << " interface: " << interface;
+    }
   }
 }