restore: Fix pipes restore if both pipe ends are used by former process
restore: Fix pipes restore if both pipe ends are used by former process

In case if the former process used both pipe ends we fall
into endless loop since the 'users' never reaches 1. So
to resolve this during the pipe collectioning we check if
both pipe ends were used by a former process and if so --
we connect first pipe end immediately in create_pipe and
connect the rest via  attach_pipe.

Signed-off-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@gmail.com>

eabatalov/criu,eabatalov/criu,rentzsch/criu,kawamuray/criu,sdgdsffdsfff/criu,marcosnils/criu,tych0/criu,AuthenticEshkinKot/criu,KKoukiou/criu-remote,gablg1/criu,ldu4/criu,tych0/criu,eabatalov/criu,wtf42/criu,marcosnils/criu,wtf42/criu,svloyso/criu,biddyweb/criu,gablg1/criu,ldu4/criu,sdgdsffdsfff/criu,KKoukiou/criu-remote,wtf42/criu,gablg1/criu,fbocharov/criu,gablg1/criu,eabatalov/criu,biddyweb/criu,kawamuray/criu,KKoukiou/criu-remote,efiop/criu,svloyso/criu,kawamuray/criu,LK4D4/criu,gonkulator/criu,AuthenticEshkinKot/criu,biddyweb/criu,KKoukiou/criu-remote,svloyso/criu,gablg1/criu,gonkulator/criu,fbocharov/criu,svloyso/criu,fbocharov/criu,efiop/criu,tych0/criu,LK4D4/criu,gonkulator/criu,efiop/criu,gonkulator/criu,rentzsch/criu,biddyweb/criu,sdgdsffdsfff/criu,AuthenticEshkinKot/criu,gonkulator/criu,marcosnils/criu,sdgdsffdsfff/criu,LK4D4/criu,wtf42/criu,fbocharov/criu,ldu4/criu,rentzsch/criu,sdgdsffdsfff/criu,fbocharov/criu,kawamuray/criu,marcosnils/criu,rentzsch/criu,eabatalov/criu,tych0/criu,biddyweb/criu,gablg1/criu,sdgdsffdsfff/criu,gonkulator/criu,fbocharov/criu,LK4D4/criu,wtf42/criu,eabatalov/criu,wtf42/criu,AuthenticEshkinKot/criu,kawamuray/criu,marcosnils/criu,kawamuray/criu,efiop/criu,marcosnils/criu,tych0/criu,AuthenticEshkinKot/criu,rentzsch/criu,LK4D4/criu,rentzsch/criu,tych0/criu,efiop/criu,LK4D4/criu,ldu4/criu,efiop/criu,KKoukiou/criu-remote,ldu4/criu,KKoukiou/criu-remote,svloyso/criu,biddyweb/criu,ldu4/criu,svloyso/criu,AuthenticEshkinKot/criu