glib: Install error callback

Install an error callback so that poppler error messages can be redirected
to the GLib logging API.

https://bugs.freedesktop.org/show_bug.cgi?id=73269
glib-demo: Fix trailing whitespaces in render.c
glib-demo: Fix conding style issue in render.c