media-keys: Fix shutdown dialog delay when using kbd shortcut
After pressing the Ctrl+Alt+Del shortcut, the shutdown dialog doesn't
appear on screen for a couple of seconds.
The media-keys daemon calls the 'Shutdown' method synchronously. After that
gnome-session calls the daemon with 'QueryEndSession'. The daemon cannot
reply as it's blocked waiting for the reply to the Shutdown method.
Sending the message asynchronously fixes that delay.
Based on report by Xiaoguang Wang <email address hidden>
When the session is inhibited from going idle e.g. because a media
player is active, we still want to blank the screen if the session is
locked (i.e. the "screensaver" is up).
Otherwise, we'd blank the screen when the session gets locked but then
on user activity we'd go back to NORMAL mode, unblanking the screen,
and ending up without an idle watch to blank again after a while since
we clear all watches and exit early if idle is inhibited.
Most of the wacom plugin code protects X11 calls with gdk_error_trap_push/pop
and prints a warning if something fails. There were two calls that were not
protected, however, and one use of g_error instead of g_warning that would
cause the g-s-d process to die if e.g. the tablet disappears while g-s-d is
trying to work on it.