daemon: Add a check for wayland sessions

We want to do some things differently, or disable some features
entirely, when running under a wayland session.

Adding a global function which tries to connect to a wayland
compositor using the same method as a regular wayland client allows us
to achieve that.

For now, since we don't need to do anything else with the wayland
connection we tear it down immediately after checking. Note that g-s-d
uses the X11 GDK backend exclusively so there's no danger of this
being a duplicated wayland connection.

This commit introduces an optional build time dependency on
libwayland-client which is, by default, enabled or disabled
automatically depending on the pc file existence.

https://bugzilla.gnome.org/show_bug.cgi?id=738009
cursor: Disable if running under a wayland session

This plugin is harmful in a wayland session because it tells XWayland
to never show a cursor which results in mutter always using the
default cursor on X clients, e.g. the cursor doesn't change to a caret
on text widgets and doesn't change to the resize cursor on window
edges for those clients' windows.

The reason why the plugin doesn't work is that it uses the GDK device
manager to enumerate devices which only knows about the virtual
XWayland devices and then tries to use those devices to ask for idle
monitors on them through the gnome-desktop API which calls out to
mutter through DBus, but mutter doesn't know about those devices since
it's managing the devices itself.

Basically, this plugin's functionality needs to be implemented by
mutter itself when running as a native wayland compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=738009