shill: Convert ProxyFactory singleton to LazyInstance.

This makes it consistent with the rest of shill's singletons (DHCPProvider,
Resolver, RoutingTable, RTNLHandler) and improves static object's memory
management.

BUG=chromium-os:19178
TEST=unit tests, tested in a VM

Change-Id: Ib403d31473360b46dd25d12508c799cbc73368fd
Reviewed-on: http://gerrit.chromium.org/gerrit/8861
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/dhcp_config.h b/dhcp_config.h
index 7b8e39d..8b81ddd 100644
--- a/dhcp_config.h
+++ b/dhcp_config.h
@@ -21,6 +21,7 @@
 class DHCPProxyInterface;
 class EventDispatcher;
 class GLib;
+class ProxyFactory;
 
 class DHCPConfig : public IPConfig {
  public:
@@ -115,6 +116,9 @@
   // its GPid, exit watch callback, and state files.
   void CleanupClientState();
 
+  // Store cached copies of singletons for speed/ease of testing.
+  ProxyFactory *proxy_factory_;
+
   DHCPProvider *provider_;
 
   // The PID of the spawned DHCP client. May be 0 if no client has been spawned