test-display: Fix potential g_object_unref(NULL) call

base_file can legitimately be NULL at this point.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=719552
portability: canonicalize_file_name -> realpath

canonicalize_file_name() is a GNU extension so let's use the portable
realpath() instead.

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