libchromeos: Fix race in DBusObject lifetime.

Fix a race where destroying a DBusObject with an ExportedObjectManager
caused a CHECK to fail if DBusInterface objects had not finished
claiming the corresponding DBus interfaces.  This happened because
an interface would not claim the interface until all handlers had
exported, while the parent DBusObject would unilaterally release
interfaces.  Now the DBusInterface owns the lifetime of its claimed
interface in the ExportedObjectManager.

BUG=brillo:110
TEST=Unittests.  This new unittest crashes before this change.

Change-Id: I54dcafc0c2de50983439ff6e4759280f25f05b75
Reviewed-on: https://chromium-review.googlesource.com/252092
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
5 files changed