More robust makedmg.sh script for Mac.