EZP-22151 Refactor Legacy SE to use Doctrine DBAL

This PR resolves issue https://jira.ez.no/browse/EZP-22151

Continued from https://github.com/ezsystems/ezpublish-kernel/pull/620