Add process input failure detection
This is a forward port of rev. 945878c49 from the
Gpg4win branch in the old KDEPIM repo. As the underlying
problem was reported again.
The failure detection is neccessary to detect preprocessing errors
which might result in valid crypto operations (e.g. working on
an empty input)
See: GnuPG-Bug-Id: 1624 for the report on this issue