Fix transactioned *OrInsert calls

Previously the race condition would end up failing the whole
transaction, defeating the point of catching it.