[1118394] deployment of new war from repo content fails
This is not a fix for the reported issue, which actually seems to not be a
bug.  This is a fix to ensure failed package installs persist the error
messageto the history record in the DB. And to provide a more useful
log message in the agent log.

Cherry-pick master ec19fd70d8db8e100b3c83c75f8d29d6c5c797ff