GNOME applications: use xid instead of pid

because pid is unreliable in wnck, get_pid() can return 0.

Also, cache the application name in the beginning because it can change
along the application life (there is a name-changed signal).