core: Make GP_DebugPrint() preserve errno.

Now all variants of GP_DebugPrint() (i.e. GP_DEBUG(), GP_WARN(), ...)
preserves errno which simplifies common pattern of:

if (failure) {
	err = errno;
	GP_DEBUG(1, "Foo has failed");
	errno = err;
	return 1;
}

to much clearer:

if (failure) {
	GP_DEBUG(1, "Foo has failed");
	return 1;
}

This commit also adds a test.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
loaders: Add GP_ReadImage()

Add a function that can read an image from an IO stream.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
loaders: ZIP: Make use of GP_ReadImage()

Now we can finally read any supported image format from a zip file.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>