Merged in rainfly patch
1. Fix rescan so that if there is an error during rescan it will not leave an incomplete database
2. Fix rescan so that it does not try to add every name in a single transaction.