core: Tidy up memory handling and fix a double-unref
core: Tidy up memory handling and fix a double-unref

This makes the memory handling a little cleaner.

pwithnall/gnome-directory-thumbnailer,GNOME/gnome-directory-thumbnailer,pwithnall/gnome-directory-thumbnailer,GNOME/gnome-directory-thumbnailer