glib: Don't create PopplerInputStream with length 0
Since commit a59f6164, PopplerInputStream requires a nonzero length.
Loosely based on an earlier patch by Kouhei Sutou. This version adds support for length == -1, which is documented to work.
Resolves: #414 (closed) Bug-Debian: https://bugs.debian.org/896596