displaymanager: Refactor the desktop environment detection to eliminate the copy&paste.

This also fixes some issues with the previous code:

* The code for LightDM only supported Xfce.

* The case where multiple desktop environments are installed was not
  handled in a good way.

* We now also check that the xsession definition actually exists. This
  allows handling the case where upstream changed the xsession
  definition's name without renaming the invoked binary.
displaymanager: Detect the KDE Plasma (5 and 4) and GNOME desktop environments.

Add them to the front of the list of desktop environments because users
are more likely to expect those as the default if they have them
installed.
displaymanager: Use a regex to match User= in sddm.conf.

This ensures we really only match the User= line and not the
RememberLastUser= one.
displaymanager: Set Session= for sddm autologin.

Detect the correct value using find_desktop_environment.
Merge pull request #140 from kkofler/detect-sddm-session-type

displaymanager: Detect SDDM session type