testing: wait until monitor has started before shutdown
testing: wait until monitor has started before shutdown

This commit fixes a test that I saw flake locally while running tests. The test output from the monitor
started immediately after the line the test was looking for.

To fix the problem a channel is closed when the goroutine starts. Shutdown is not called until this channel
is closed, which seems to greatly reduce the chance of a flake.

hashicorp/consul,hashicorp/consul,hashicorp/consul,hashicorp/consul