[BUGFIX] Fix PHP warning when writing to Backend user log

The writelog method for the BackendUserAuthentication object is now
checking if there is actually an uid available in the user array
before it tries to access it.

This prevents a PHP warning about an illegal string offset when writing
log messages in an authentication service.

Releases: 6.0, 6.1, 6.2
Resolves: #49328
Change-Id: I006c6b0ccd8f03292715a7d7ab8e457914637d93
Reviewed-on: https://review.typo3.org/23116
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit f36574c7a975e93c3a1faf9f3fcace280cda71a8)
Reviewed-on: https://review.typo3.org/23917