MDL-58050 message: Fix the DB transaction handling
MDL-58050 message: Fix the DB transaction handling

Consumer code is not supposed to call commit_delegated_transaction()
method directly, this was incorrect usage of the delegated transactions.

dilawar/moodle