Use transaction in setup script. Use better getRandomString for salt.

Transaction in setup script makes large migration safer.

getRandomString in Magento CE is terrible, especially older versions which have only 1000000 seed values reducing effectiveness of salt.