gdk_drawable_get_screen() used for mask, which is a pixmap, not a window

The function gtk_drag_set_icon_pixmap() triggered failing assertions. This was because it called the function gdk_window_get_screen(mask), where "mask" is a pixmap, but not a window.

https://bugzilla.gnome.org/show_bug.cgi?id=735005
threads: Do not release the GDK lock if it hasn't been acquired yet

Since GLib ≥ 2.41, attempting to release an unlocked mutex will abort(),
as it happens on most systems already.

Given the lack of proper documentation on how to use GDK with threads,
there is code in the wild that does:

    gdk_threads_init ();
    gdk_init ();

    ...

    gtk_main ();

instead of the idiomatically correct:

    gdk_threads_init ();
    gdk_threads_enter ();

    gtk_init ();

    ...

    gtk_main ();

    ...

    gdk_threads_leave ();

Which means that gtk_main() will try to release the GDK lock, and thus
trigger an error from GLib.

we cannot really fix all the wrong code everywhere, and since it does
not cost us anything, we can work around the issue inside GDK itself, by
trying to acquire the GDK lock inside gdk_threads_leave() with
trylock().

https://bugzilla.gnome.org/show_bug.cgi?id=735428
win32: provide an implementation for gdk_test_simulate_key().

https://bugzilla.gnome.org/show_bug.cgi?id=734879
pixbuf engine: Avoid a crash if widget is NULL

Commit 85f2a721cf introduced an unconditional call to
gtk_widget_get_direction(). This does not work for 'foreign'
uses of the theme engine, e.g. in Qt, where widget is NULL.

This was reported as a crash in Fedora here:
https://bugzilla.redhat.com/show_bug.cgi?id=924683