Add ability to enable/disable debug with GSettings

Based on similar commit in mate-session-manager.