add monkey patch to write file only after commit

This ensure a file is never created on filesystem while transaction will restart.

This former behavior was creating multiple times the same file.
transaction_actions is a list of the class here. It will be shared across instances.
You better have to use hasattr / getattr in the methods add_transaction_action,  commit and rollback in order to add the attribute with a new list if it doesn't exist yet. cr._cnx would no longer be necessary BTW