OpenPGP: re-factor pgp_set_blob()
OpenPGP: re-factor pgp_set_blob()

* NULL-ify freed data pointer
* avoid unnecessary malloc() calls
* cope with malloc() errors
* do not rely on blob->file for be set

Signed-off-by: Peter Marschall <peter@adpm.de>

git-svn-id: 444ed946b9c2220da791e84c3dd156a05f92db99@5474 c6295689-39f2-0310-b995-f0e70906c6a9

dengert/OpenSC,0x7678/myOpenSC,dengert/OpenSC,germanblanco/OpenSC,financeX/OpenSC,Jakuje/OpenSC,financeX/OpenSC,hhonkanen/OpenSC,dirkx/OpenSC,marschap/pkg-opensc,carlhoerberg/OpenSC,financeX/OpenSC,rickyepoderi/OpenSC,financeX/OpenSC,dirkx/OpenSC.tokend,0x7678/OpenSC,germanblanco/OpenSC,mtrojnar/OpenSC,germanblanco/OpenSC,dirkx/OpenSC.tokend,dirkx/OpenSC,gentoo/OpenSC,kasparsd/opensc-latvia-id,dirkx/OpenSC,dirkx/OpenSC,velter/OpenSC,fabled/OpenSC,CardContact/OpenSC,gemini/OpenSC,dengert/OpenSC,metsma/OpenSC,rickyepoderi/OpenSC,velter/OpenSC,martinpaljak/OpenSC,rickyepoderi/OpenSC,0x7678/myOpenSC,fabled/OpenSC,LudovicRousseau/OpenSC,adminmt/OpenSC,CardContact/OpenSC,gentoo/OpenSC,hongquan/OpenSC-main,viktorTarasov/OpenSC-SM,velter/OpenSC,LudovicRousseau/OpenSC,tidatida/OpenSC,LudovicRousseau/OpenSC,metsma/OpenSC,OpenSC/OpenSC,UIKit0/OpenSC,martinpaljak/OpenSC,philipWendland/OpenSC,gemini/OpenSC,0x7678/myOpenSC,OpenSC/OpenSC,aobaid/OpenSC,nmav/OpenSC,ieugen/OpenSC,tidatida/OpenSC,Jakuje/OpenSC,hhonkanen/OpenSC,0x7678/myOpenSC,frankmorgner/OpenSC,tidatida/OpenSC,UIKit0/OpenSC,marschap/pkg-opensc,0x7678/myOpenSC,viktorTarasov/OpenSC-SM,kasparsd/opensc-latvia-id,jpki/OpenSC,frankmorgner/OpenSC,gentoo/OpenSC,marschap/pkg-opensc,AktivCo/OpenSC,ieugen/OpenSC,hongquan/OpenSC-main,hhonkanen/OpenSC,AktivCo/OpenSC,Jakuje/OpenSC,gentoo/OpenSC,fabled/OpenSC,kasparsd/opensc-latvia-id,mouse07410/OpenSC,l1k/OpenSC,frankmorgner/OpenSC,mouse07410/OpenSC,jpki/OpenSC,viktorTarasov/OpenSC-SM,velter/OpenSC,marschap/pkg-opensc,l1k/OpenSC,metsma/OpenSC,adminmt/OpenSC,gentoo/OpenSC,ieugen/OpenSC,aobaid/OpenSC,martinpaljak/OpenSC,carlhoerberg/OpenSC,ieugen/OpenSC,adminmt/OpenSC,gemini/OpenSC,Jakuje/OpenSC,jpki/OpenSC,philipWendland/OpenSC,fabled/OpenSC,UIKit0/OpenSC,0x7678/OpenSC,frankmorgner/OpenSC,0x7678/OpenSC,dirkx/OpenSC.tokend,financeX/OpenSC,nmav/OpenSC,carlhoerberg/OpenSC,dirkx/OpenSC.tokend,CardContact/OpenSC,kasparsd/opensc-latvia-id,ieugen/OpenSC,tidatida/OpenSC,AktivCo/OpenSC,UIKit0/OpenSC,dirkx/OpenSC,hongquan/OpenSC-main,dirkx/OpenSC.tokend,0x7678/OpenSC,adminmt/OpenSC,mtrojnar/OpenSC,carlhoerberg/OpenSC,nmav/OpenSC,aobaid/OpenSC,philipWendland/OpenSC,mouse07410/OpenSC,mtrojnar/OpenSC,aobaid/OpenSC,OpenSC/OpenSC,dirkx/OpenSC.tokend,l1k/OpenSC,carlhoerberg/OpenSC