sd-login: add C API to query primary session of a user