Fixes to make it work

I added unit-test (with gocheck, I hope it's not a problem for you), reverted [this commit](davecheney/xattr@fe267a52f85cb48f31e61cfe2edd2a5e22d0f59b) (why it was done in first place?), added handling of errno 0 and unified Linux and Darwin code.