[DBAgent] Add a new method: transaction().

Previously we use macros DBCLIENT_TRANSACTION_BEGIN() and TRANSACTION()
to write code that runs in the transaction. However, the code with these
seems to be storange syntax.

So this patch adds a C++ friendly way to write code for a transaction.