buffet: Use 'gdbus wait' in post-start stanza of Upstart job.

This should fix the race with 'restart buffet' exiting before buffet
claims its D-Bus name.

BUG=brillo:641
TEST=Ran buffet_Registration 100 times without seeing D-Bus errors.
CQ-DEPEND=CL:262610

Change-Id: I01bf94c90a533e3e396fbb9131b7377e72f217e0
Reviewed-on: https://chromium-review.googlesource.com/262620
Trybot-Ready: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/buffet/etc/init/buffet.conf b/buffet/etc/init/buffet.conf
index 1e27a53..49c7b7f 100644
--- a/buffet/etc/init/buffet.conf
+++ b/buffet/etc/init/buffet.conf
@@ -27,3 +27,6 @@
     --config_path="${BUFFET_CONFIG_PATH}" \
     --state_path="${BUFFET_STATE_PATH}" \
     --test_definitions_path="${BUFFET_TEST_DEFINITIONS_PATH}"
+
+# Wait for daemon to claim its D-Bus name before transitioning to started.
+post-start exec gdbus wait --system --timeout 30 org.chromium.Buffet