libsystemd-logind: fix detection of session/user/machine of a PID