pkg/system.getxattr: handle changed size case
pkg/system.getxattr: handle changed size case

lgetxattr(2) man page says:

> If size is specified as zero, these calls return the  current  size  of
> the  named extended attribute (and leave value unchanged).  This can be
> used to determine the size of the buffer that should be supplied  in  a
> subsequent  call.   (But, bear in mind that there is a possibility that
> the attribute value may change between the two calls,  so  that  it  is
> still necessary to check the return status from the second call.)

The current code does not handle the case when the size changes between
the two calls, and the new size is larger.

Fix the above problem, and slightly simplify the code.

Signed-off-by: Kir Kolyshkin <3a017b8ddb3f9cf3e4a59978b004111bdeb97f08@gmail.com>

kojiromike/docker,moby/moby,AkihiroSuda/docker,jthelin/docker,mahak/docker,vdemeester/docker,AkihiroSuda/docker,trebonian/docker,ibuildthecloud/docker,moul/docker,jameszhan/docker,flavio/docker,moul/docker,Mokolea/docker,vdemeester/docker,moul/docker,konstruktoid/docker-1,konstruktoid/docker-1,konstruktoid/docker-upstream,dims/docker,djs55/docker,bearstech/moby,docker/docker,nalind/docker,estesp/docker,estesp/docker,justincormack/docker,jvanz/docker,ibuildthecloud/docker,Ramzec/docker,thaJeztah/docker,gnailuy/docker,Mokolea/docker,vdemeester/docker,paralin/docker,jthelin/docker,moby/moby,yosifkit/docker,djs55/docker,konstruktoid/docker-upstream,AkihiroSuda/docker,jimjag/docker,Ramzec/docker,ibuildthecloud/docker,trebonian/docker,thaJeztah/docker,bearstech/moby,moby/moby,gnailuy/docker,cpuguy83/docker,moby/moby,jimjag/docker,yosifkit/docker,justincormack/docker,justincormack/docker,cpuguy83/docker,docker/docker,nawawi/docker,trebonian/docker,nalind/docker,paralin/docker,flavio/docker,AkihiroSuda/docker,yosifkit/docker,bearstech/moby,yosifkit/docker,mahak/docker,docker/docker,dims/docker,konstruktoid/docker-upstream,nalind/docker,jameszhan/docker,jvanz/docker,flavio/docker,estesp/docker,nawawi/docker,jimjag/docker,Ramzec/docker,paralin/docker,nawawi/docker,cpuguy83/docker,kojiromike/docker,thaJeztah/docker,djs55/docker,Mokolea/docker,gnailuy/docker,ibuildthecloud/docker,paralin/docker,Ramzec/docker,ibuildthecloud/docker,jimjag/docker,konstruktoid/docker-upstream,jvanz/docker,moul/docker,thaJeztah/docker,gnailuy/docker,mahak/docker,dims/docker,flavio/docker,nalind/docker,nawawi/docker,cpuguy83/docker,mahak/docker,kojiromike/docker,jameszhan/docker,bearstech/moby,trebonian/docker,Mokolea/docker,konstruktoid/docker-1