Standalone install.sh only uses sudo if it has to

Modify the standalone install.sh to check for write permission on
the `/usr/local` dir before requesting root privileges with sudo.

Allows users with user-writable `/usr/local` directories (e.g.
most users of Homebrew on Mac OS X) to install as themselves.