base1: Fix race condition in "watch change" dbus test
base1: Fix race condition in "watch change" dbus test

Install the "notify" handler before calling watch(). Before the test had
a race condition where watching finished before the onnotify_cache() was
installed, and thus `cache` was empty.

Also wait until watch() succeeds, so that the subsequent test does not
run into assertions being called after done(). watch() is guaranteed to
return after notify handlers got called [1], this ensures that this
actually happens.

[1] https://cockpit-project.org/guide/latest/cockpit-dbus.html#cockpit-dbus-watch

Closes #14993

cockpit-project/cockpit,mvollmer/cockpit,mvollmer/cockpit,deryni/cockpit,deryni/cockpit,martinpitt/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,deryni/cockpit,martinpitt/cockpit,garrett/cockpit,mvollmer/cockpit,deryni/cockpit,garrett/cockpit,martinpitt/cockpit,garrett/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,mvollmer/cockpit,martinpitt/cockpit,garrett/cockpit,martinpitt/cockpit,mvollmer/cockpit,deryni/cockpit,garrett/cockpit,deryni/cockpit,deryni/cockpit