multi-tenancy: db: Select the right database
multi-tenancy: db: Select the right database

We use the tenant name to determine which database to use.

Tenant databases are prefixed with rm_, so a tenant called otl will
have a database called rm_otl

In the case of non multi-tenancy mode, the database is as defined by the
DB_NAME config option.

Also seeing as a copy of db_conn() is now in the mail receiver and db.c
isn't being shared, we can get rid of the conditional compilation on
_RECEIPTOMATIC_WWW_ being defined.

Signed-off-by: Andrew Clayton <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@opentechlabs.co.uk>

ac000/receiptomatic