[shill] Un-do a few usages of ref-counted pointers where they cause cycles

Giving an Adaptor a ref-counted pointer to the object for which it is an adaptor
causes an ownership cycle that leads to memory leaks.

In lieu of trying to create some more formal structure, just rely on the fact
that a Device/Service/Manager creates and owns its Adaptor and give a bare
pointer to the Adaptor when it is created.

BUG=chromium-os:16259
TEST=unit tests

Change-Id: Idf909270a156bc97c4f8d4f0a493284d7197a1c8
Reviewed-on: http://gerrit.chromium.org/gerrit/2306
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/device_dbus_adaptor.cc b/device_dbus_adaptor.cc
index adade7d..9a3f05e 100644
--- a/device_dbus_adaptor.cc
+++ b/device_dbus_adaptor.cc
@@ -20,13 +20,14 @@
 // static
 const char DeviceDBusAdaptor::kPath[] = "/device/";
 
-DeviceDBusAdaptor::DeviceDBusAdaptor(DBus::Connection* conn,
-                                     DeviceRefPtr device)
+DeviceDBusAdaptor::DeviceDBusAdaptor(DBus::Connection* conn, Device *device)
     : DBusAdaptor(conn, kPath + device->UniqueName()),
       device_(device) {
 }
 
-DeviceDBusAdaptor::~DeviceDBusAdaptor() {}
+DeviceDBusAdaptor::~DeviceDBusAdaptor() {
+  device_ = NULL;
+}
 
 void DeviceDBusAdaptor::UpdateEnabled() {}