Application of a693af4 (Adds fix for race condition where primary keys are violated on INSERT) from doIncrementUpdateOrInsert to doSetUpdateOrInsert