pam: Don't use geteuid() to get uid for authenticated user

Instead we use the 'struct passwd' that we looked up earlier.

This causes issues when the PAM stack is not running as the user
but as root or someone else.

https://bugzilla.gnome.org/show_bug.cgi?id=733418