Make ExportedObject and ObjectProxy own Bus as scoped_refptr.

They should own Bus as scoped_refptr, rather than raw pointer.
Otherwise, they may reference |bus_| after Bus is deleted.

I know this is convoluted. I'm planning to minimize use of
scoped_refptr from dbus/* but this change is necessary until then.

TEST=run dbus_unittest under valgrind and confirm no memory leaks
BUG=chromium-os:21379


Review URL: http://codereview.chromium.org/8201023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105222 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index 999727a9..bbd2a4c 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -46,6 +46,8 @@
                           "/org/chromium/DifferentTestObject");
   ASSERT_TRUE(object_proxy3);
   EXPECT_NE(object_proxy1, object_proxy3);
+
+  bus->ShutdownAndBlock();
 }
 
 TEST(BusTest, GetExportedObject) {
@@ -70,6 +72,8 @@
                              "/org/chromium/DifferentTestObject");
   ASSERT_TRUE(object_proxy3);
   EXPECT_NE(object_proxy1, object_proxy3);
+
+  bus->ShutdownAndBlock();
 }
 
 TEST(BusTest, ShutdownAndBlock) {