Fix issues with Person.setUserId unicity check

Person.setUserId is heavy, it serializes person module to prevent concurrency,
but in some cases we the risk of having duplicate user ids is under control, so
we don't want to pay the performance price.

See merge request !1242
7 jobs for master
in 0 seconds, using 0 compute credits, and was queued for 0 seconds