Fix flaky tests further broken by XMPP ASN change fix.

As a result of commit e383a8eedc0b3b7106ea5ed13d5f92ee2753ade0 all XMPP
connections are flapped when the ASN is changed.  Since the mock agent
used in some unit/module tests does not re-subscribe to instances if a
connection flaps, some tests got broken.

Specifically, tests that did not configure an ASN (or anything else) at
the start of the test, brought up XMPP connections to mock agents, and
only then configured the ASN (and routing-instances), were impacted.

Fix is to tweak the tests to minimally configure the ASN at the start.

Also tweak the ASNUpdate test in rtarget_peer_test to account for XMPP
connection flap.

Use XmppStateMachineTest which uses small timer values so that the XMPP
connections come back quickly after a flap. Add the class in the common
bgp_server_test_util.h file and remove duplicate definitions from other
places.

Change-Id: I67f739c8f1fcdda4ac923fa42d74e75b343180ae
Bug 1349957: Get tenant id before deleting the port

Change-Id: I4eb8a3b0692bf283befb9fb361f17d32c863bee2
Add uuid to the NamespaceTask

This patch introduces an uuid to the
NamespaceTask class in order to use it
for the map between task and svc_instance.

The aim of this change is fix potential
concurrency issue.

Change-Id: I036dcd13357b4539d6d303610f5e9d44d65a2790
Merge "Bug 1349957: Get tenant id before deleting the port"
Merge "Add uuid to the NamespaceTask"
Merge "Fix flaky tests further broken by XMPP ASN change fix."
Fix concurrency issue in lifetime manager.

Some unit tests failed during TearDown when trying to access a
virtual method for a partially destroyed object.  One thread was
in the process of removing a dependent object's LifetimeRef from
the parent LifetimeActor's dependency list. This was happening
via the destructor for the dependent object.  At the same time,
the main thread was in the process of propagating Delete from the
parent LifetimeActor to it's dependents.

Fix is to perform propagation of delete from the LifetimeManager
task rather than doing it inline from the Delete method.  Notice
that this splits up delete propagation into multiple steps.  An
actor propagates delete to it's immediate children.  If a child
has a LifetimeActor it gets added to the LifetimeManager queue.
Further propagation happens when the child LifetimeActor itself
is processed from the queue.

This change broke some tests which expected that the delete is
propagated inline.  As an example, if the MemebershipManager is
stopped and has requests to process, and a routing instance is
deleted, the tables for the instance don't get marked deleted
as BgpServer::IsReadyForDeletion doesn't let the LifetimeManager
task process the queue.

Fixed this issue by adding a MayDestroy method to LifetimeManager.
Instead of not processing the LifetimeManager queue at all, we
now process the first item on the queue, invoking Shutdown and
PropagateDelete if needed, and then put the LifetimeActor back on
the queue if MayDestroy returns false.

Defined a BgpLifetimeManager class whose MayDestroy method calls
BgpServer::IsReadyForDeletion.

Change-Id: I6b5688f5362fbf5591c84c78f56e4a682cb95587