Fix docker restart panic on machine ungracefully shutdown
Fix docker restart panic on machine ungracefully shutdown

Machine ungracefully shutdown leaves a lot of container has a
Running=true state.

```
$ cat config.v2.json | jq .

    "Running": true,
    "Paused": false,
    "Restarting": false,

```

And the next docker start will fail with panic.

```

time="2016-12-01T01:54:45.086446715-05:00" level=warning msg="libcontainerd: client is out of sync, restore was called on a fully synced container (49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a)."
time="2016-12-01T01:54:45.087046004-05:00" level=warning msg="libcontainerd: failed to retrieve container 49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a state: rpc error: code = 2 desc = containerd: container not found"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5db7f3]

goroutine 57 [running]:
panic(0x16a8e60, 0xc420010130)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/docker/docker/libcontainerd.(*client).Restore(0xc4202e1a40, 0xc420415000, 0x40, 0xc42015a0b0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/docker/libcontainerd/client_linux.go:457 +0x553
github.com/docker/docker/daemon.(*Daemon).restore.func1(0xc4201c46f0, 0xc4202581e0, 0xc4201c46e8, 0xc42047bfb0, 0xc42047bf80, 0xc42047bf50, 0xc42024ba10, 0xc420512c00)
        /go/src/github.com/docker/docker/daemon/daemon.go:205 +0x198
created by github.com/docker/docker/daemon.(*Daemon).restore
        /go/src/github.com/docker/docker/daemon/daemon.go:260 +0x7bb

```

Signed-off-by: Lei Jitang <9ac444d2b5df3db1f31aa1c6462ac8e9e2bde241@huawei.com>

mkumatag/docker,sdurrheimer/docker,rancher/docker,michael-holzheu/docker,rremer/moby,HideoYamauchi/docker,cpuguy83/docker,dims/docker,rremer/moby,naveed-jamil-tenpearls/moby,kencochrane/docker,ibuildthecloud/docker,kencochrane/docker,resin-io/docker,lixiaobing10051267/docker,bonczj/moby-json-file-logger,madhanrm/docker,pramodhkp/moby,gschaetz/moby,djs55/docker,sarnautov/moby,PatrickLang/moby,YuPengZTE/docker,srust/docker,gschaetz/moby,Ramzec/docker,kojiromike/docker,kolyshkin/moby,michael-holzheu/docker,POLJM242/docker,ibuildthecloud/docker,mike1729/docker,jwhonce/docker,justincormack/docker,gnailuy/docker,dmcgowan/docker,jwhonce/docker,nawawi/docker,dsheets/moby,darrenstahlmsft/moby,ibuildthecloud/docker,mixja/docker,konstruktoid/docker-upstream,imkin/moby,mstanleyjones/docker,srust/docker,docker/docker,unclejack/docker,Mokolea/docker,dgageot/docker,diogomonica/docker,raja-sami-10p/moby,miminar/docker,yummypeng/docker,docker/docker,tonistiigi/docker,catinthesky/docker,dmcgowan/docker,sterchelen/docker,konstruktoid/docker-upstream,noironetworks/docker,moypray/docker,rhatdan/docker,ibuildthecloud/docker,trebonian/docker,ffoysal/docker,moul/docker,kolyshkin/docker,naveed-jamil-tenpearls/moby,trebonian/docker,charleszheng44/moby,nalind/docker,HideoYamauchi/docker,JMesser81/docker,dsheets/moby,alfred-landrum/docker,moby/moby,tianon/docker,shishir-a412ed/docker,haveatry/docker,yosifkit/docker,konstruktoid/docker-upstream,bearstech/moby,dperny/docker,ColinHebert/docker,crosbymichael/docker,gjaskiewicz/moby,yasiramin10p/moby,nawawi/docker,mike1729/docker,x1022as/docker,paralin/docker,allencloud/docker,lixiaobing1/docker,flavio/docker,dccurtis/docker,erikstmartin/docker,haveatry/docker,tianon/docker,KingEmet/docker,KingEmet/docker,shhsu/docker,rhatdan/docker,johnstep/moby-moby,PatrickLang/moby,Ramzec/docker,justincormack/docker,q384566678/docker,johnstep/moby-moby,mahak/docker,kolyshkin/docker,rremer/moby,laijs/docker,dsheets/moby,vdemeester/docker,danyalKhaliq10p/moby,mtesselH/docker,whuwxl/docker,catinthesky/docker,mixja/docker,rancher/docker,gnailuy/docker,yasiramin10p/moby,coolljt0725/docker,Mokolea/docker,cyphar/docker,sterchelen/docker,charleszheng44/moby,laijs/docker,yummypeng/docker,thaJeztah/docker,x1022as/docker,sdurrheimer/docker,dccurtis/docker,tklauser/docker,tophj-ibm/moby,coreos/docker,fcrisciani/docker,cyphar/docker,madhanrm/docker,thaJeztah/docker,nawawi/docker,yosifkit/docker,AkihiroSuda/docker,KarthikNayak/docker,rancher/docker,johnstep/moby-moby,djs55/docker,laijs/moby,sdurrheimer/docker,kojiromike/docker,scotttlin/docker,mixja/docker,nawawi/docker,thaJeztah/docker,akira-baruah/docker,xuxinkun/docker,dims/docker,bearstech/moby,thtanaka/docker,nalind/docker,naveed-jamil-tenpearls/moby,ffoysal/docker,mahak/docker,jlhawn/docker,mstanleyjones/docker,erikh/docker,yongtang/docker,jthelin/docker,darrenstahlmsft/moby,bearstech/moby,imkin/moby,sterchelen/docker,KingEmet/docker,tklauser/docker,moul/docker,harche/docker,q384566678/docker,liaoqingwei/docker,yosifkit/docker,kojiromike/docker,tklauser/docker,Mokolea/docker,pramodhkp/moby,thaJeztah/docker,mikedougherty/docker,ibuildthecloud/docker,hqhq/moby,mikebrow/docker,harche/docker,trebonian/docker,estesp/docker,xuxinkun/docker,erikstmartin/docker,laijs/moby,laijs/moby,prertik/docker,jlhawn/docker,flavio/docker,JMesser81/docker,dperny/docker,maxamillion/docker,ndeloof/docker,kolyshkin/moby,coolljt0725/docker,crosbymichael/docker,charleszheng44/moby,mahak/docker,jameszhan/docker,tophj-ibm/moby,Syntaxide/docker,whuwxl/docker,jvanz/docker,resin-io/docker,vdemeester/docker,bonczj/moby-json-file-logger,thtanaka/docker,alfred-landrum/docker,mikebrow/docker,maxamillion/docker,YuPengZTE/docker,noironetworks/docker,jimjag/docker,konstruktoid/docker-1,flavio/docker,mike1729/docker,ripcurld0/moby,SvenDowideit/docker,mtesselH/docker,yasiramin10p/moby,raja-sami-10p/moby,ndeloof/docker,tophj-ibm/docker,haveatry/docker,x1022as/docker,coolljt0725/docker,moby/moby,Mokolea/docker,shhsu/docker,xuxinkun/docker,srust/docker,nalind/docker,cyphar/docker,danyalKhaliq10p/moby,coreos/docker,hqhq/moby,scotttlin/docker,duglin/docker,djs55/docker,ripcurld0/moby,mstanleyjones/docker,cpuguy83/docker,AkihiroSuda/docker,HideoYamauchi/docker,ColinHebert/docker,mikebrow/docker,Syntaxide/docker,moul/docker,prertik/docker,paralin/docker,duglin/docker,diogomonica/docker,SvenDowideit/docker,whuwxl/docker,mkumatag/docker,yosifkit/docker,Syntaxide/docker,darrenstahlmsft/docker,KarthikNayak/docker,gjaskiewicz/moby,maxamillion/docker,gjaskiewicz/moby,mikedougherty/docker,miminar/docker,pradipd/moby,gnailuy/docker,cpuguy83/docker,moypray/docker,unclejack/docker,erikstmartin/docker,unclejack/docker,resin-io/docker,jimjag/docker,nalind/docker,YuPengZTE/docker,tophj-ibm/docker,dgageot/docker,Ramzec/docker,tonistiigi/docker,jthelin/docker,gnailuy/docker,tmp6154/docker,darrenstahlmsft/docker,tophj-ibm/docker,ffoysal/docker,jameszhan/docker,POLJM242/docker,qudongfang/docker,dmcgowan/docker,liaoqingwei/docker,gschaetz/moby,pramodhkp/moby,cpuguy83/docker,konstruktoid/docker-1,justincormack/docker,kencochrane/docker,moby/moby,sarnautov/moby,q384566678/docker,crosbymichael/docker,konstruktoid/docker-upstream,qudongfang/docker,madhanrm/docker,shishir-a412ed/docker,estesp/docker,amatsus/docker,danyalKhaliq10p/moby,lixiaobing10051267/docker,docker/docker,diogomonica/docker,fcrisciani/docker,dims/docker,akira-baruah/docker,moul/docker,mahak/docker,darrenstahlmsft/docker,ndeloof/docker,paralin/docker,tmp6154/docker,bonczj/moby-json-file-logger,JMesser81/docker,jimjag/docker,shhsu/docker,mkumatag/docker,noironetworks/docker,jvanz/docker,tophj-ibm/moby,AkihiroSuda/docker,fcrisciani/docker,allencloud/docker,pradipd/moby,coreos/docker,duglin/docker,AkihiroSuda/docker,dccurtis/docker,moypray/docker,yongtang/docker,scotttlin/docker,jameszhan/docker,qudongfang/docker,ripcurld0/moby,thtanaka/docker,jwhonce/docker,PatrickLang/moby,darrenstahlmsft/moby,yummypeng/docker,tmp6154/docker,amatsus/docker,moby/moby,erikh/docker,rhatdan/docker,KarthikNayak/docker,amatsus/docker,estesp/docker,prertik/docker,erikh/docker,raja-sami-10p/moby,lixiaobing1/docker,liaoqingwei/docker,yongtang/docker,kolyshkin/moby,sarnautov/moby,miminar/docker,allencloud/docker,shishir-a412ed/docker,mtesselH/docker,jlhawn/docker,jvanz/docker,dgageot/docker,konstruktoid/docker-1,flavio/docker,dperny/docker,lixiaobing1/docker,jimjag/docker,imkin/moby,vdemeester/docker,mikedougherty/docker,catinthesky/docker,harche/docker,lixiaobing10051267/docker,tonistiigi/docker,bearstech/moby,Ramzec/docker,hqhq/moby,SvenDowideit/docker,laijs/docker,pradipd/moby,alfred-landrum/docker,michael-holzheu/docker,trebonian/docker,ColinHebert/docker,paralin/docker