Handle images with a reported size of zero

If a zero-byte file was encountered, such as when reading from a HTTP
server which does not report file sizes, a zero-byte buffer was
allocated and passed to g_input_stream_read_all(), triggering an assert
in the image loading code.

Avoid the problem by treating a non-zero file size as an optimisation,
allocating a buffer for the input file if the size is available, and
splicing the file input stream to a GMemoryOutputStream.

https://bugzilla.gnome.org/show_bug.cgi?id=728602
https://retrace.fedoraproject.org/faf/problems/1662964/