brew: added safeguards in script and changed default branch to 'master'