gi-test: Fix gir file tests

Meson unfortunately does not normalize the paths for us, so we couldn't
just rely on it to give us the correct target name without the full
target path when the path separator is not '/' (such as on Visual Studio
builds, where the path separator is '\\' (with escape character).

This means that, that on Visual Studio builds, targetname would be:

D:\\gi.build\\tests\\scanner\\Typedefs-1.0.gir

instead of:

Typedefs-1.0.gir

Since we have the targetbase variable which actually has the correct
info we need, use that to deduce the correct reference .gir file to
compare to.
5 jobs for gnome-3-32 in 8 minutes and 2 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #290089
fedora-x86_64-autotools

00:02:42

passed #290088
fedora-x86_64-meson

00:01:16

passed #290091
win32
msys2-mingw32-autotools

00:07:39

passed #290090
win32
msys2-mingw32-meson

00:03:12

passed #290092
win32
vs2017-x64-meson

00:04:48