Setting same value to OCS privatedata API on MySQL causes row duplication

When doing the following:
1) Try a SQL UPDATE to change a value
2) If zero rows were updated, try an INSERT

The trouble with this logic is that MySQL returns "zero rows updated" if the passed values are the same as the existing ones in the DB.

This is potentially harmful. I grepped the code and there is only one other location (in encryption migration) that seem to rely on this.

I don't have a good fix yet but wanted to discuss this here.
The PR brings a unit test that will trigger the error (curious to see what other DBs will fail)

I'd rather expect from Doctrine that the "num_rows" returned is consistent between DBs.

@DeepDiver1975 @karlitschek @schiesbn @icewind1991 @bartv2