avoid hang on lxc exec ls < /dev/zero
avoid hang on lxc exec ls < /dev/zero

Waiting until stdin closes isn't the right thing to do, since we
can pipe in unlimited unending data through stdin.

Instead, when runcommand exits and we are noninteractive, close the
container ends of stdin/out/err.  Those will then flush, and be
sent over to the client, which will eventually close and send
stdEof <- true, allowing us to finish.

All testcases still pass with this patch, and

lxc exec ls < /dev/zero

no longer hangs

Signed-off-by: Serge Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

ollie314/lxd,lxc/lxd,pcdummy/lxd,achanda/lxd,Skarlso/lxd,rcj4747/lxd,achanda/lxd,ericsnowcurrently/lxd,Malizor/lxd,lxc/lxd,hallyn/lxd,akshaykarle/lxd,hallyn/lxd,mjeanson/lxd,ollie314/lxd,techtonik/lxd,georghopp/lxd,dvbportal/osx-lxd,jensg-st/lxd,jsavikko/lxd,benaryorg/lxd,lxc/lxd,dvbportal/osx-lxd,Skarlso/lxd,rcj4747/lxd,jsavikko/lxd,stgraber/lxd,pcdummy/lxd,smoser/lxd,akshaykarle/lxd,lxc/lxd,Skarlso/lxd,jumpstarter-io/lxd,ericsnowcurrently/lxd,sl1pm4t/lxd,stgraber/lxd,dustinkirkland/lxd,techtonik/lxd,atxwebs/lxd,Skarlso/lxd,yura-pakhuchiy/lxd,hallyn/lxd,smoser/lxd,Malizor/lxd,rcj4747/lxd,sl1pm4t/lxd,mjeanson/lxd,atxwebs/lxd,mjeanson/lxd,basvanbeek/lxd,atxwebs/lxd,stgraber/lxd,dustinkirkland/lxd,smoser/lxd,yura-pakhuchiy/lxd,benaryorg/lxd,chrisglass/lxd,erikmack/lxd,ollie314/lxd,hallyn/lxd,rrva/lxd,stgraber/lxd,hallyn/lxd,hallyn/lxd,stgraber/lxd,jensg-st/lxd,beni55/lxd,benaryorg/lxd,achanda/lxd,erikmack/lxd,mikemccracken/lxd,lxc/lxd,atxwebs/lxd,ericsnowcurrently/lxd,lxc/lxd,basvanbeek/lxd,stgraber/lxd,rrva/lxd,beni55/lxd,stgraber/lxd,mikemccracken/lxd,Malizor/lxd,beni55/lxd,jensg-st/lxd,erikmack/lxd,georghopp/lxd,chrisglass/lxd,georghopp/lxd,chrisglass/lxd,jsavikko/lxd,akshaykarle/lxd,jumpstarter-io/lxd,rrva/lxd,yura-pakhuchiy/lxd,mikemccracken/lxd,techtonik/lxd,jumpstarter-io/lxd,basvanbeek/lxd,pcdummy/lxd,lxc/lxd,dvbportal/osx-lxd,dustinkirkland/lxd,sl1pm4t/lxd