agent: Fix sync issues with exit code and stdout of a process
agent: Fix sync issues with exit code and stdout of a process

The patch about subreaping introduced some bugs by removing some
code that was actually very important. This code relates to the
synchronization of the stdout coming from the process and its exit
code being returned before. In case the exit code was returned before
stdout was not forwarded to the shim since the connection had been
dropped.

This commit restores few lines of code ensuring all output has been
forwarded before to send the exit code.

Fixes #196

Signed-off-by: Sebastien Boeuf <90b401417360b1924ef3f520ddee932686110f85@intel.com>

clearcontainers/agent,clearcontainers/agent