when launching multiple agents at same time, there is a chance that
agents will miss the registry of another agent. this is possible
because there is a lot of overhead involved when starting up agents,
specifically with initialising managers.
this change makes it so the agent only joins the group AFTER it has
done all setup that does not require coordination. after it joins,
we start listening right away for other changes to group membership
additionally, this adds a lock to pipeline queue setup so only one
event at any time can trigger a reconfiguration.
Change-Id: I8100160a3aa83a190c4110e6e8be9b26aef8fd1c
Closes-Bug: #1533787