Fix deadlock condition
Fix deadlock condition

This is a quick on-spot fix, would be nice to actually rework the
overall implementation to avoid this hackish solution.

The problem is that STI.Save (for saving artifacts) calls RunContainer
with opts.OnStart set to a function that reads from the read half of a
pipe, while the write half is set as the container stdout. Docker won't
close the container's output and error streams upon termination
(expected behavior), so OnStart will never terminate, it will block
forever waiting for more data to be read.

With OnStart blocked, RunContainer is blocked, and STI.Save never
returns, thus the deferred call to close the pipe halves is never
executed, thus the deadlock.

gabemontero/source-to-image,csrwng/source-to-image,bparees/source-to-image,liggitt/source-to-image,liggitt/source-to-image,mfojtik/source-to-image,coreydaley/source-to-image,mdshuai/source-to-image,csrwng/source-to-image,mdshuai/source-to-image,csrwng/source-to-image,openshift/source-to-image,bparees/source-to-image,PI-Victor/source-to-image,danmcp/source-to-image,danmcp/source-to-image,soltysh/source-to-image,openshift/source-to-image,bparees/source-to-image,mfojtik/source-to-image,dobbymoodge/source-to-image,coreydaley/source-to-image,rhcarvalho/source-to-image,PI-Victor/source-to-image,gabemontero/source-to-image,guangxuli/source-to-image,rhcarvalho/source-to-image,guangxuli/source-to-image,soltysh/source-to-image,jim-minter/source-to-image,rhcarvalho/source-to-image,openshift/source-to-image,PI-Victor/source-to-image,coreydaley/source-to-image,bparees/source-to-image,gabemontero/source-to-image,coreydaley/source-to-image,mfojtik/source-to-image,rhcarvalho/source-to-image,dobbymoodge/source-to-image,PI-Victor/source-to-image,guangxuli/source-to-image,liggitt/source-to-image,guangxuli/source-to-image,php-coder/source-to-image,jim-minter/source-to-image,dobbymoodge/source-to-image,jim-minter/source-to-image,csrwng/source-to-image,soltysh/source-to-image,liggitt/source-to-image,gabemontero/source-to-image,soltysh/source-to-image,php-coder/source-to-image,mfojtik/source-to-image,dobbymoodge/source-to-image,jim-minter/source-to-image