gplazma2-grid: Fix user name regression in authzdb plugin

Addresses the issue that authzdb may add a second UserNamePrincipal and thus
cause the validation phase of a login to fail. This is a regression introduced
in 2.6.1.

The patch restores the old behaviour. The logic is not exactly beatiful, but
given that space manager relies on authorization by user name, it makes sense
that the user name is consistent with the UID. Hence if UID is selected by
something different that user name, then we have to replace the user name.

Target: trunk
Request: 2.6
Require-notes: yes
Require-book: no
Patch: http://rb.dcache.org/r/5660/
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
(cherry picked from commit 0b075daae5204b3ae8d7cfae2d0a72b748e6e57a)