DB: Add SQLSTATE to debug log

Use Utils::writeLogDbError() for database related errors. It adds the SQLSTATE and the database error description to database output debug logs.

See #49.