Add support for compiling against Gtk+3 with and without Wayland backend

This patch allows mate-terminal to be compiled against Gtk+3 both with and without a Wayland backend.

I've tested:
* Gtk+3 with X11 and Wayland
* Gtk+2 with X11