buffet: Mark CloudDelegateImpl state on registration success

This was lost during merging privetd and buffet.
Without that second registration is not possible as device reports
that pending registration in progress.

BUG=brillo:1216
TEST=run twice localapis:register_privet_devices_prod_test

Change-Id: Idc7666ea8b875c39b1afd3f489d3c94aca1b1d49
Reviewed-on: https://chromium-review.googlesource.com/280881
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/privet/cloud_delegate.cc b/buffet/privet/cloud_delegate.cc
index 83c7bbb..7c9adc5 100644
--- a/buffet/privet/cloud_delegate.cc
+++ b/buffet/privet/cloud_delegate.cc
@@ -319,7 +319,8 @@
   void CallManagerRegisterDevice(const std::string& ticket_id, int retries) {
     chromeos::ErrorPtr error;
     if (device_->RegisterDevice(ticket_id, &error).empty())
-      RetryRegister(ticket_id, retries, error.get());
+      return RetryRegister(ticket_id, retries, error.get());
+    setup_state_ = SetupState(SetupState::kSuccess);
   }
 
   buffet::CommandInstance* GetCommandInternal(const std::string& command_id,