BUG: Prevent ObjectFactoryBase from possibly throwing an exception

Coverity produces over 250 errors due to the fact that
ObjectFactoryBase::RegisterInternal() has the structural capability to
throw an uncaught exception, if m_RegisteredFactories is non-empty.

However, as currently implemented, when ObjectFactoryBase::
RegisterInternal() is called, it is logically impossible for
m_RegisteredFactories to be non-empty. Verifying this precondition as a
check against future bugs is still good idea, but errors will now only be
produced in debug mode. In all build configurations, m_RegisteredFactories
will be cleared (which should be a small, constant-time overhead), to
guarantee consistent behavior.

Change-Id: Ia5890a323a7e8d5ed6b44195158a7a05f2c5df3e
Merge topic 'ObjectFactoryException'

302d53c BUG: Prevent ObjectFactoryBase from possibly throwing an exception