Fix typo in table name for ir.module

issue3951
review14531002
Fix restore of database

- Use a transaction to execute query
- Fix usage of update

issue3951
review14531002