Fixing releaseableLayer handling of layer streams and mounts.
Fixing releaseableLayer handling of layer streams and mounts.

releaseableLayer includes automatic handling for creating a read/write layer and mounting it on a call to Mount(), but then does not correspondingly unmount the layer before trying to delete it, which will fail for some graphdrivers. Commit on a releaseable layer also leaks the tarstream for the layer. To fix this, the stream close is deferred in Commit and releaseRWLayer now correctly handles unmounting the layer before trying to delete it.  In addition, the changes include better error handling in Release() to make sure that errors are returned to the caller for failures on read/write layers instead of being ignored.# Please enter the commit message for your changes. Lines starting

Signed-off-by: Stefan Wernli <83146b3f843e2cabf52cc6abaa32c20ae61a0a7e@ntdev.microsoft.com>

haveatry/docker,PatrickLang/moby,konstruktoid/docker-upstream,kojiromike/docker,SvenDowideit/docker,liaoqingwei/docker,djs55/docker,tmp6154/docker,tklauser/docker,bearstech/moby,duglin/docker,yongtang/docker,Mokolea/docker,coolljt0725/docker,rremer/moby,tmp6154/docker,shishir-a412ed/docker,ibuildthecloud/docker,YuPengZTE/docker,yummypeng/docker,rancher/docker,ibuildthecloud/docker,vdemeester/docker,jimjag/docker,coolljt0725/docker,madhanrm/docker,djs55/docker,pradipd/moby,crosbymichael/docker,mahak/docker,kolyshkin/docker,mikebrow/docker,dims/docker,dmcgowan/docker,KingEmet/docker,yosifkit/docker,thaJeztah/docker,cyphar/docker,ripcurld0/moby,jameszhan/docker,flavio/docker,jlhawn/docker,vdemeester/docker,moby/moby,srust/docker,trebonian/docker,trebonian/docker,gnailuy/docker,konstruktoid/docker-upstream,ndeloof/docker,konstruktoid/docker-upstream,laijs/moby,jameszhan/docker,jthelin/docker,amatsus/docker,Ramzec/docker,noironetworks/docker,trebonian/docker,docker/docker,KarthikNayak/docker,whuwxl/docker,jwhonce/docker,rhatdan/docker,flavio/docker,unclejack/docker,flavio/docker,pradipd/moby,danyalKhaliq10p/moby,mahak/docker,ibuildthecloud/docker,duglin/docker,nalind/docker,raja-sami-10p/moby,hqhq/moby,johnstep/moby-moby,jwhonce/docker,yummypeng/docker,KarthikNayak/docker,kolyshkin/moby,docker/docker,tmp6154/docker,justincormack/docker,konstruktoid/docker-1,vdemeester/docker,cyphar/docker,jvanz/docker,unclejack/docker,moby/moby,mixja/docker,Ramzec/docker,justincormack/docker,justincormack/docker,mkumatag/docker,coolljt0725/docker,kolyshkin/moby,nawawi/docker,paralin/docker,mahak/docker,madhanrm/docker,fcrisciani/docker,PatrickLang/moby,ripcurld0/moby,raja-sami-10p/moby,whuwxl/docker,coreos/docker,naveed-jamil-tenpearls/moby,AkihiroSuda/docker,unclejack/docker,jthelin/docker,liaoqingwei/docker,pramodhkp/moby,AkihiroSuda/docker,jlhawn/docker,mkumatag/docker,ibuildthecloud/docker,mixja/docker,moul/docker,johnstep/moby-moby,yosifkit/docker,haveatry/docker,laijs/moby,KarthikNayak/docker,fcrisciani/docker,YuPengZTE/docker,yongtang/docker,scotttlin/docker,moby/moby,sterchelen/docker,shishir-a412ed/docker,tophj-ibm/moby,tophj-ibm/docker,konstruktoid/docker-1,whuwxl/docker,kolyshkin/moby,estesp/docker,dims/docker,tophj-ibm/docker,rhatdan/docker,nawawi/docker,tonistiigi/docker,maxamillion/docker,maxamillion/docker,docker/docker,SvenDowideit/docker,tonistiigi/docker,gnailuy/docker,mikebrow/docker,flavio/docker,scotttlin/docker,ripcurld0/moby,rhatdan/docker,jvanz/docker,srust/docker,Mokolea/docker,miminar/docker,srust/docker,raja-sami-10p/moby,cyphar/docker,gnailuy/docker,jimjag/docker,mike1729/docker,Ramzec/docker,djs55/docker,danyalKhaliq10p/moby,dsheets/moby,KingEmet/docker,naveed-jamil-tenpearls/moby,laijs/moby,dccurtis/docker,tophj-ibm/docker,duglin/docker,allencloud/docker,hqhq/moby,rancher/docker,shishir-a412ed/docker,dmcgowan/docker,allencloud/docker,pramodhkp/moby,thaJeztah/docker,paralin/docker,thaJeztah/docker,nawawi/docker,madhanrm/docker,jwhonce/docker,estesp/docker,scotttlin/docker,mike1729/docker,jvanz/docker,moul/docker,tklauser/docker,kojiromike/docker,moul/docker,amatsus/docker,sterchelen/docker,yosifkit/docker,allencloud/docker,jimjag/docker,coreos/docker,SvenDowideit/docker,pramodhkp/moby,crosbymichael/docker,crosbymichael/docker,yosifkit/docker,noironetworks/docker,Ramzec/docker,gnailuy/docker,bearstech/moby,fcrisciani/docker,dims/docker,konstruktoid/docker-upstream,tophj-ibm/moby,cpuguy83/docker,hqhq/moby,jlhawn/docker,nalind/docker,ndeloof/docker,miminar/docker,KingEmet/docker,AkihiroSuda/docker,mikebrow/docker,mike1729/docker,x1022as/docker,x1022as/docker,rremer/moby,johnstep/moby-moby,bearstech/moby,paralin/docker,ibuildthecloud/docker,dccurtis/docker,miminar/docker,bearstech/moby,tklauser/docker,Mokolea/docker,moby/moby,AkihiroSuda/docker,rremer/moby,danyalKhaliq10p/moby,maxamillion/docker,rancher/docker,tonistiigi/docker,tophj-ibm/moby,dmcgowan/docker,liaoqingwei/docker,cpuguy83/docker,haveatry/docker,konstruktoid/docker-1,amatsus/docker,yongtang/docker,PatrickLang/moby,trebonian/docker,mkumatag/docker,coreos/docker,YuPengZTE/docker,estesp/docker,cpuguy83/docker,nalind/docker,laijs/docker,thaJeztah/docker,pradipd/moby,mixja/docker,nalind/docker,kojiromike/docker,dsheets/moby,naveed-jamil-tenpearls/moby,Mokolea/docker,laijs/docker,moul/docker,yummypeng/docker,kolyshkin/docker,cpuguy83/docker,dsheets/moby,mahak/docker,nawawi/docker,jameszhan/docker,dccurtis/docker,ndeloof/docker,jimjag/docker,x1022as/docker,sterchelen/docker,paralin/docker,laijs/docker,noironetworks/docker