Handle pkgaction errors. Refs #2029

If the pkgaction process exit with non-zero status, print the error
message.