Fixes bug 1032851 - add a retry if we get a duplicate on UPSERT

this addition is the correct way to handle the problem.  the entire transaction is being retried.