Use access instead of stat in PathExists and PathIsWritable.

This change fixes the issue where PathIsWritable returns the wrong
answer when called by the superuser. It also slightly simplifies the
code.

This fix is helpful for Chrome OS because Chrome OS uses
PathIsWritable in backlight-tool

TEST=Verified that this change fixes backlight-tool (part of the Chrome OS power manager).
BUG=none

Patch by davidjames

http://codereview.chromium.org/2073005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47418 0039d316-1c4b-4281-b951-d872f2087c98
1 file changed