database: Replace the old database model with a connection pool
This patch introduces a connection pool to the database. When a function
is executing a query, a connection will be handed to the (asyncio) Task
and remains with that task until its end.
That way, multiple concurrent tasks (even when they are running in the
same thread) will have an exclusive connection to the database which
will avoid that we overwrite and commit transactions of other tasks.
Additionally, transactions can now be nested as psycopg's transactions
are more advanced than the previous Transaction class.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>