Check returned error before using when registering with session manager

Apparently, the call to register with gnome-session-manager can fail without
setting a GError, and, in any case, it doesn't hurt to check that the error
is set before using it.

https://bugzilla.gnome.org/show_bug.cgi?id=710689