Remove SESSION_CONFIGURED global from DB fixture
Remove SESSION_CONFIGURED global from DB fixture

The SESSION_CONFIGURED global flag is used in the Database fixture to
guard against the reconfiguration of the DB context in each test as the
global transaction factory does not allow such reconfiguration. However
this global is error prone for multiple reasons:

 * there are tests that actually configure the factory outside of the
   fixture causing tests to interfere

 * we use one single global flag but we always have two separate
   Database fixture one for the api DB and one for the main DB. Still
   the fixture instantiated first will do the configuration of both
   DB factory.

This patch replaces the global with two individual oslo_db enginefacade
patch_factory() calls that allows patching and resetting the global
factory per test case.

Change-Id: Ifc070d19a18a2d66f1a7bd5898428b12901dfe9e

openstack/nova,mahak/nova,openstack/nova,mahak/nova,mahak/nova,openstack/nova