shill: Add code to wait for dhcpcd to exit before continuing.

In the past, we stop dhcpcd by sending it a SIGTERM without waiting for
it to exit.  This cause a race condition where the first instance of
dhcpcd is still exiting when we start the second instance.  The second
instance fails to acquire the lock that is still held by the first
instance so it exits.  Eventually, the first instance also exits and
we're left with no dhcpcd running.  This CL waits for dhcpcd to exit
after we send it a SIGTERM.

BUG=chromium-os:26580
TEST=Unit tests, run network_WiFiManager and examine the messages to
ensure that processing does not continue until after dhcpcd exits

Change-Id: I8b4c9ea21ec652eb36f69b37841424b72c0f6078
Reviewed-on: https://gerrit.chromium.org/gerrit/16323
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
diff --git a/dhcp_config.h b/dhcp_config.h
index 4ea147b..f8cf28d 100644
--- a/dhcp_config.h
+++ b/dhcp_config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -77,6 +77,8 @@
   static const char kConfigurationKeyRouters[];
   static const char kConfigurationKeySubnetCIDR[];
 
+  static const int kDHCPCDExitPollMilliseconds;
+  static const int kDHCPCDExitWaitMilliseconds;
   static const char kDHCPCDPath[];
   static const char kDHCPCDPathFormatLease[];
   static const char kDHCPCDPathFormatPID[];