Make upower optional

This commit is just an improved version of the pull request by Wolfgang Ulbrich
at https://github.com/mate-desktop/mate-session-manager/pull/38
making it working with both upower and systemd, and improving configure part