Use access function rather than custom one.

This is not supported under Windows, but there is a similar
function that we can use there (_access_s in io.h).