Clear cached engine when global engine changes

The keystone.common.sql.core.Base class cached the global database
engine when get_session() was called. When the global database engine
changed to a new instance, the cached copy was used in subsequent
calls to get_session(), leading to using the old engine and tests
failing to run by themselves.

This change makes it so that when the global database engine is
changed, Base will use the new engine rather than the invalid one.

Change-Id: I75aa3c230d9b4fd666ab8d478c9e9a27669905e8
Fixes: Bug #1179259
Merge "Clear cached engine when global engine changes"