scanner: Fix shlib resolution on W32

GI just adds '.dll' to library name and calls it a day.  There's a
comment about how this function might work, i've used it to implement
something better.  This requires a compiler that supports
-print-search-dirs argument (i.e.  gcc) and a dlltool.

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