Don't begin heartbeating until the API server is listening

As soon as the agent sends its first heartbeat, it may begin receiving
API calls. As such, we should wait until the server is actually
listening before starting the heartbeater.

Change-Id: Id2984f3f0f50cdb725b10913d38b990f99c48b0a
Use processutils properly

Previously this code was calling processutils.execute incorrectly,
expecting it to return the exit code. This change:

* fixes calls to processutils.execute
* fixes related tests
* changes exceptions triggered by shell command failure to
  subclass processutils.ProcessExecutionError, to properly capture
  commands, stdout, stderr, etc. from processutils.execute().

Change-Id: I3343f104a5a8200d53bd87a8799ff918e375b17f
(cherry picked from commit 0e4acce6cb9ec9edd62b3a19a60a951fc0509849)