Add a configure check for hi-dpi support

In order to support hi-dpi (GDK_SCALE) we need new-enough versions
of both GTK+ and cairo. Add a configure check for the appropriate
functions and define HAVE_HIDPI_SUPPORT.

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