daemon: xattr: factorize do_getxattr and do_lgetxattr

Move all the common code to a new _getxattr function, much like done for
other xattrs operations.

Mostly code motion, no functional changes.