restore: wait while processes are dying
restore: wait while processes are dying

If criu restore failed, criu should wait all processes because they
hold files, namespaces and other stuff that caller might want to
have released (in our case it was ploop device).

Here we do this only for cases when processes are restored in a pid
namespace. We'd like to do the same for non-ns case, but there's
no simple way to wait for a bunch of unconnected processes.

Another good side effect is that "Restoring FAILED." will be printed
at the end of the log (now after we kill init tasks still have time
to do smth and write log messages).

Cc: Nikita Spiridonov <e2c2785991de10f66b050593578d4296c6c8705d@odin.com>
Reported-by: Nikita Spiridonov <e2c2785991de10f66b050593578d4296c6c8705d@odin.com>
Signed-off-by: Andrew Vagin <74c05afa918858348d6db8037d82fa8124870113@openvz.org>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

wtf42/criu,wtf42/criu,fbocharov/criu,KKoukiou/criu-remote,tych0/criu,tych0/criu,fbocharov/criu,eabatalov/criu,svloyso/criu,tych0/criu,AuthenticEshkinKot/criu,AuthenticEshkinKot/criu,ldu4/criu,tych0/criu,efiop/criu,ldu4/criu,tych0/criu,wtf42/criu,fbocharov/criu,ldu4/criu,AuthenticEshkinKot/criu,AuthenticEshkinKot/criu,fbocharov/criu,efiop/criu,eabatalov/criu,KKoukiou/criu-remote,KKoukiou/criu-remote,svloyso/criu,KKoukiou/criu-remote,eabatalov/criu,wtf42/criu,eabatalov/criu,ldu4/criu,AuthenticEshkinKot/criu,tych0/criu,KKoukiou/criu-remote,fbocharov/criu,svloyso/criu,svloyso/criu,eabatalov/criu,KKoukiou/criu-remote,svloyso/criu,efiop/criu,efiop/criu,efiop/criu,fbocharov/criu,ldu4/criu,svloyso/criu,ldu4/criu,AuthenticEshkinKot/criu,wtf42/criu,wtf42/criu,eabatalov/criu,efiop/criu