shill: modem: unregister the cellular device when deleting a modem

Unregister the cellular device so that the chain of refences to the
device are all dropped when the modem disappears.  The references are
from DeviceInfo, Manager, Modem and Service.  Calling deregister
remove the device info reference, and will cause the manager to stop
the device, which will in turn clean up the service.  Deleting the
modem will drop the last reference.

BUG=chromium-os:26796, chromium-os:26300
TEST=run shill, list-devices, stop cromo, list-devices, start cromo,
     /opt/Qualcomm/bin/powercycle-all-gobis

Change-Id: Ia10932cc3c644bbf5accd69e02b85c75dc783b11
Reviewed-on: https://gerrit.chromium.org/gerrit/16546
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
diff --git a/modem.cc b/modem.cc
index c61ba76..0d4711b 100644
--- a/modem.cc
+++ b/modem.cc
@@ -43,7 +43,11 @@
   LOG(INFO) << "Modem created: " << owner << " at " << path;
 }
 
-Modem::~Modem() {}
+Modem::~Modem() {
+  if (device_.get()) {
+    manager_->device_info()->DeregisterDevice(device_);
+  }
+}
 
 void Modem::Init() {
   VLOG(2) << __func__;