CommandChain and ManagedCmd fixes to prevent goroutine leakage

This is part of #505 and should prevent any goroutines from leaking in the ProcessInput code.

* invoke drainChannels prior to exiting from ManagedCmd::Wait()
* ManagedCmd timeout is just a special case of Stopping now to prevent goroutine leaks
* CommandChain was leaking goroutines on subcommand error. Chains now
  report a single aggregate error to prevent goroutine leaks.