Allow DI of database object (see https://github.com/joomla/joomla-cms/pull/4992)