gresource: Fix potential array overflow if using empty paths

Adds tests to cover this case and similar cases for various GResource
methods in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

GNOME/glib#927
7 jobs for 927-resource-path-fix in 17 minutes and 44 seconds (queued for 14 minutes and 59 seconds)
Status Job ID Name Coverage
  Build
passed #57796
cross-android_api21_arm64

00:01:31

passed #57797
cross-android_api28_arm64

00:01:36

passed #57798
cross-mingw64

00:02:01

passed #57795
fedora-x86_64

00:03:18

passed #57799
win32
msys2-mingw32

00:05:35

passed #57800
win32
vs2017-x64

00:06:07

 
  Coverage
passed #57801
coverage

00:01:10

77.0%