zdtm/pty02: never close master before reading slave
zdtm/pty02: never close master before reading slave

We may close the master before reading the slave if the child runs first
when the parent wakes it up using task_waiter_complete. In this case the
subsequent read from the slave will return 0 resulting in a false
positive test failure:

13:23:42.194: 30914: ERR: pty02.c:89: read(slave) failed (errno = 11 (Resource temporarily unavailable))

Fix this by waking the child, which closes the master, only after the
read has been completed.

Also note errno = EAGAIN in the failure report above, which looks really
confusing. Let's print the actual number of bytes read/written along
with the errno while reporting a read/write failure to make the error
reporting clearer in this test.

Signed-off-by: Vladimir Davydov <0d62248ee021b6e01c0ee596a62a5b145b996974@parallels.com>
Cc: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@parallels.com>
Acked-by: Andrew Vagin <74c05afa918858348d6db8037d82fa8124870113@parallels.com>
Acked-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@parallels.com>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

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