Use new cursor to check access in ModuleInstallUpgrade

check_access take a lock on many tables and so it prevents those tables to be
modified by the installation/upgrade process as far as the cursor is not
closed.

issue4223
review13571002
Avoid double evaluation from inherit with different model

safe_eval forbid to evaluate '__' but PYSON encoded contains such strings. So
with inherit from different model, the XML attributes could already been
encoded we should prevent to evaluate them a second times because it will fail.

issue4228
review5681002