Avoid the "key conflict attempting to insert a user row" exception in some cases

bug: 41609
Change-Id: Iebfcf50e648a43f2970e6d0e4073cb6d84d260df