restore_root_task(): fix calling try_clean_remaps
restore_root_task(): fix calling try_clean_remaps

1. As pointed out by Coverity (CID 114629), mnt_ns_fd is closed,
but then the function calls try_clean_remaps(mnt_ns_fd)
which tries to close the file descriptor which is already closed.

To address this, let's use safe_close() which sets closed fd to -1.
As it also checks its argument, there's no need for explicit check
so let's remove "if" check before close().

2. As Pavel pointed out, "calling the whole try_clean_remaps()
is not required once we've passed the cleanup_mnt_ns() point".
This could be addressed by introducing yet another label, but
it's cleaner to just use a flag variable.

Note that since the second issue is being addressed, the first one
goes away, but let's keep the fix for it anyway, it might help in
the future.

Signed-off-by: Kir Kolyshkin <c0159612b0ef32139322233232df1a0d189c4b9b@openvz.org>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

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