ref/profiles/internal/rt: Ensure the agents client doesn't close before it should.

Currently many objects depend on the principal to finish their cleanup.
Unfortunately we didn't record this dependency becuase non-agent principals
don't get cleaned up, and therefore, don't need to be tracked.  The agent
principal, however, uses a client which will get closed at some point.  We
need to ensure that the client doesn't get closed before any clients and servers
using the principal are finished.

This CL introduces a dependency arc between the agent principal and the client
and between new clients and servers and their pricipals.

There is still an issue if a user sets a principal, we don't know its dependencies.
If people end up making their own principals this issue will resurface.

Change-Id: Ie9298f25b8a40bfe9815aa6c4cc31eeaf37f540d
1 file changed