build: use AM_PROG_AR conditionally

AM_PROG_AR does not exist in automake v0.11 but without it, you can't
build libuv with automake v0.12+ on Darwin.
test: fix fs_fstat test on sunos

The tests are no longer compiled with -D_XOPEN_SOURCE=500 when building
with autotools. Tell the test explicitly that SunOS systems are
expected to have nanosecond fstat(2) granularity.
test: fix fs_chown when running as root

chown(2) to root is expected to fail - unless you're root, of course.