build: Log errors. Fix the gpg-agent mess.

If a build fails, a message is printed to stderr:

    "'$pkgbuild' failed with error code $?"

gpg-agent is now killed on exit.