win32: improve the package installation dir lookup

As an example, the core of gedit is in a private library
placed in %INSTALLDIR%/lib/gedit/libgedit.dll

Before this patch we would get %INSTALLDIR%/lib/gedit as the
installation package dir, while what we actually want is to get
%INSTALLDIR%

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