handle QueryEndSession from the session manager

If we register with the SM, we must connect to and respond to
QueryEndSession, otherwise we are deemed unresponsive and the
user is asked what to do.