MariaDB: add mariadb_get_conn function

Signed-off-by: swpd <swpdtz@gmail.com>
MariaDB: remove unused states

Signed-off-by: swpd <swpdtz@gmail.com>
MariaDB: implement error and close callbacks

Signed-off-by: swpd <swpdtz@gmail.com>