core: create custom pivot tables inside a transaction.
core: commit any changes from Module:manage_schema before handling the #datamodel. Not committing the the transaction locks the rsc table if a new fk constraint to the rsc table was created.