Fix recover() for agent cmd handler.  Tweak the error message wording.  Add recover() in a couple more places.
Recover main agent goroutine.