shill: Framework for asynchronous service side RPC calls.

Use the framework to switch EnterPIN to return asynchronously.

Also, added a few try/catch clauses around DBus proxy calls to ease testing and
debugging. They should go away as we transition to asynchronous proxy calls.

BUG=chromium-os:17263
TEST=unit tests, tested on device

Change-Id: I4177c5b91e23c31838b03689de729932c859a936
Reviewed-on: https://gerrit.chromium.org/gerrit/12541
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/device_dbus_adaptor.cc b/device_dbus_adaptor.cc
index b3c2270..87cedb2 100644
--- a/device_dbus_adaptor.cc
+++ b/device_dbus_adaptor.cc
@@ -106,9 +106,10 @@
 }
 
 void DeviceDBusAdaptor::EnterPin(const string &pin, ::DBus::Error &error) {
-  Error e;
-  device_->EnterPIN(pin, &e);
-  e.ToDBusError(&error);
+  VLOG(2) << __func__;
+  Returner *returner = Returner::Create(this);
+  device_->EnterPIN(pin, returner);
+  returner->DelayOrReturn(&error);
 }
 
 void DeviceDBusAdaptor::UnblockPin(const string &unblock_code,