Fix use-after-free

Thanks to LebedevRI for spotting that in the clang output.
(cherry picked from commit 78fe76472c3701274cbb719dfd77127fe2a908ee)
Merge branch 'darktable-1.2.x' of https://github.com/darktable-org/darktable into darktable-1.2.x
appdata: initial appdata support

according to:
http://people.freedesktop.org/~hughsient/appdata/

syntax validated with the relaxng schema
(cherry picked from commit 52704c6a8f971a904428e6681c60566363e60d7f)
FindSaxon.cmake: fix for Gentoo Linux

On Gentoo Linux, saxon.jar is installed into /usr/share/saxon-6.5/lib/, where FindSaxon.cmake isn't looking
(cherry picked from commit 0442b959a3882fb769973712d9880e3ddf325380)