Log warning when no uid was found for user

In some incomplete setups (like mine) it can happen that the uid
attribute of users is missing.

To be able to find out that something is wrong, a debug message is now
logged when it has not been found.

Backport of 59f9107dd9497d2eb9bd61f5eb8d893dd8fcb766 from master