libweave: Fix notification channel update after device registration

Buffet failed to notify GCD server of channel change when the original
resource update request was in flight.

Make sure to queue the channel update request if the initial update
is in flight.

BUG=brillo:1268
TEST=`FEATURES=test emerge-link buffet`
     `test_that -b link <ip> "e:buffet_.*"`

Change-Id: Ie80172be020d0cbd9fa6925cc6be900cfc341935
Reviewed-on: https://chromium-review.googlesource.com/290303
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/libweave/src/device_registration_info.cc b/libweave/src/device_registration_info.cc
index ff35f5c..da310a6 100644
--- a/libweave/src/device_registration_info.cc
+++ b/libweave/src/device_registration_info.cc
@@ -1119,7 +1119,10 @@
   pull_channel_->UpdatePullInterval(config_->backup_polling_period());
   current_notification_channel_ = primary_notification_channel_.get();
 
-  if (!connected_to_cloud_)
+  // If we have not successfully connected to the cloud server and we have not
+  // initiated the first device resource update, there is nothing we need to
+  // do now to update the server of the notification channel change.
+  if (!connected_to_cloud_ && in_progress_resource_update_callbacks_.empty())
     return;
 
   // Once we update the device resource with the new notification channel,