ConsoleKit is obsoleted by systemd-logind. Accordingly, port the current CK code to systemd. In order to be nice to the Debian people fall back to CK if systemd is not found, so that the code makes the best of whatever it runs on.