Add desktop environment detection

My last patch causes Gnome Keyring to be launched even though the desktop
environment is KDE. This patch detects the running desktop environments and
tries to pick the matching storage backend.