dump: Factor out img header dumping
dump: Factor out img header dumping

Move common code for tasks and threads dumping into routine. It will be
used for zombies as well.

Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>
Signed-off-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@openvz.org>

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