application: Add a query-end signal

This lets us take just-in-time inhibitors, and makes
the session support a little more real.
2 jobs from portal-session-state in 8 minutes and 20 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #194145
build

00:08:20

manual #194146
win32 allowed to fail manual
msys2-mingw32