test/zdtm/cwd00: add error checking to cleanup code
test/zdtm/cwd00: add error checking to cleanup code

The checking helps debug unexpected failures.

The patch is useful to debug test failure. Chdir() may meet failure
if the process does not have enough permissioin. Then, it cannot
rename in-progress output file to output file. Finally, test script
cannot catch 'PASS' flag from the output file and record it as
failure. As the result, the test fails without any error message.

Signed-off-by: Yicheng Qin <8b417266d69cc94b7bc0eab417ec6120cde0ecb3@google.com>
Acked-by: Andrew Vagin <74c05afa918858348d6db8037d82fa8124870113@parallels.com>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

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