toolbar: Simplify update

- Use set_visible() to show/hide widgets
- Call set_custom_title() only once
- Hide back button if selection mode is enabled
Lower required version of GTK+
Use libgd widgets instead of gtk+ if the later is too old

Import Stack, StackTransitionType and StackSwitcher from libgd if gtk+ is older
than 3.9.0.
Use HeaderBar from libgd if not available in gtk+

Also, rename data/Headerbar.ui to data/headerbar.ui.in which configure will use
as the template for data/headerbar.ui file.
toolbar: Don't set custom title on Toolbar init

This makes sure that the label created by the header is realized on init.
The setting of the state of the toolbar to 0 will do this anyway.
window: Pack header bar if GTK+ version is older than 3.9.0

gtk_window_set_titlebar was introduced in 3.9.0.
toolbar: Destroy the window on close if GTK+ version is older than 3.9.8

gtk_window_close was introduced in 3.9.8.
window: Hide titlebar when maximized if GTK+ version is older than 3.9.0

We can't set a custom titlebar before 3.9.0, so hide the titlebar from the
window manager when maximized.
Pass an empty string as illegal characters for unescaping

This is for backwards compatibility with GLib <= 2.36
toolbar: Hide close button if not maximized and header bar is not title bar

If GTK+ version is older than 3.9.0 which allows custom title bars, show the
close button of the header bar if we are maximized and selection mode is not
enabled.