[#5254] Pre-process configuration to inject DB adapter instance

- Looks for a named DB adapter in the writer configuration, and, if
  found, retrieves it from the service locator passed to the factory,
  re-setting the db configuration to use the discovered adapter.
Fixes #5254

Merge branch 'weierophinney-hotfix/5254'

* weierophinney-hotfix/5254:
  [#5254] Pre-process configuration to inject DB adapter instance