with_db_lock: Perform a DB query, with locking
Description
This creates a transaction, and an exclusive lock.
It always creates a new DB connection, and closes it on exit.
Usage
with_db_lock(db_file, expr)
Arguments
expr
Expression to evaluate, it can refer to the connection
handle as db
.