MDL-43761 make mysql table creation use only one query
MDL-43761 use atomic db changes in pg

This should partially help with recovery from interrupted installs.