gpgscm: Improve robustness and compatibility.