reg-files: skip size for O_APPEND|O_WRONLY files, v2
reg-files: skip size for O_APPEND|O_WRONLY files, v2

This is common for log files, when a number of processes
are writing something into one file. Currently, if someone
wrote something to log since dump happened, on restore criu
will complain about "File has bad size" and refuse to restore.

If file is opened with O_APPEND|O_WRONLY flags it is going to
jump to the EOF anyway.

v2, use O_ACCMODE and separate helper

Signed-off-by: Ruslan Kuprieiev <d5a72ee952151c96ed45519d39706302c0610b8a@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

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