gnupg2: replace patch with inreplace.
gnupg2: cleanup system calls.