Context manager generator for retry block pattern and decorator.

According to the docs `SET TRANSACTION` only changes the isolation mode for the next transaction that is opened. All other transactions will open with the default isolation level.

If 1. `set_mode_read_committed` was called and 2. a transaction was opened. Then if this function is called and a transaction is opened, it will open with the default REPEATABLE READ isolation.

However if 1. `set_mode_read_committed` was called but 2. a transaction was not opened. Then if this function is called and a transaction is opened, yes, it will open with the READ COMMITTED isolation.

Currently, both the decorators and the context manager do open a transaction after calling either of these functions. So to save a query, I did not explicitly set the isolation level. Should I add the query or just make a note here about this?

http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html