libostree: Add API to append a GPG signature

This will be used by rpm-ostree which needs to use an external program
to sign commits.
libostree: Fix crash if output is not a tty

This was a recent regression.