Make all the 'INSERT or REPLACE' SQL operations run in a transaction -

this is a big performance increase even if there are only a moderate
number of addresses to add or update.