Issue 104 cannot exec setuids

Previously, misinterpreted that os.access(file, X_OK)
always returns True on Solaris.  Yes, but only for
the uid of 0. Python issue #13706 closed "not a bug"
reads to "just use os.stat()", so we went to great
lengths to do so quite exhaustively.

But this is wrong -- *only* when root, should we check
the file modes -- os.access of X_OK works perfectly
fine for non-root users.

And, we should only check if any of the executable bits
are set.  Alas, it is true, you may execute that which
you may not read -- because as root, you can always read
it anyway.

Verified similar solution in NetBSD test.c (/bin/test),
OpenBSD ksh for its built-in test, and what FreeBSD/Darwin
for their implementation of which.c.

Tested on OSX and Solaris, travis on Linux, of course.
Manually tested pexpect.which('sudo') on OSX and Solaris,
especially on Solaris as root and user nobody.
> Does this depend on whether you're in the group owning the file?

So in these test cases, we are the owner of the file. Even though it has group read/execute, the owner field takes precedence. I added a comment to indicate as such.

$ ls -ld /tmp/p
----r-x---  1 jquast  wheel  0 Dec 19 18:23 /tmp/p*
$ /tmp/p
bash: /tmp/p: Permission denied