appchooser, main, wallpaper, wallpaperdialog: Fix a few memory errors and missing error handling pointed out by Coverity
Some of these fixes also apply to xdg-desktop-portal-gtk
, so I will be sending a pull request shortly.
Edited by Debarshi Ray