removed two dbwrite locks from migration code

#1041 and #1135