pdf: Fix dispose implementation

Dispose must be safe against multiple runs, so set pointers to NULL
after freeing them.
5 jobs for wip/chpe/fix-dispose in 4 minutes and 31 seconds (queued for 3 seconds)
Status Name Job ID Coverage
  Build
passed flatpak #1661360
flatpak

00:04:31

manual master #1661356
allowed to fail manual
passed meson #1661357

00:00:41

manual meson-gtk-doc #1661359
allowed to fail manual
passed meson-internal-synctex #1661358

00:00:37