Properly map the parameters and result from access to stat and back

Since stream wrappers only implement stat. Fixes #2304.

I'm not sure how to do unit tests for this, since the file permissions do not seem to be guaranteed on the test server, and definitely not when using repo authoritative mode. I also don't see tests for is_writable and friends, so I've not implemented any here.