restorer: fix a race condition between access and unmap to task_entries
restorer: fix a race condition between access and unmap to task_entries

If we have tree threads, a following situation can occur:

T2: dec task_entries->nr_in_progress
T3: dec task_entries->nr_in_progress
T3: futex(&task_entries->nr_in_progress, WAKE_UP);
T1: unmap task_entries
T2: futex(&task_entries->nr_in_progress, WAKE_UP) -> EFAULT -> BUG_ON()

This patch adds a futex for synchronising threads.

Signed-off-by: Andrey Vagin <74c05afa918858348d6db8037d82fa8124870113@openvz.org>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

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