Use chunked xattr reading in OS X sys_lgetxattr().
Create and use write_bigbuf() function for extra-large buffer sizes.