Be a bit more careful detecting the platform

Only run bash_completion (from the brew directory) if we're on OSX, and if
homebrew is installed.