[ticket/10966] Introduce some DBAL base classes.

The mysql/mysqli and mssql/mssql_odbc/mssqlnative dbals have various methods
that duplicate each other.
Introduce two base classes that are extended by these dbal classes and
implements these methods.

PHPBB3-10966