Upgrade: Bug fix for installation on Mac

Bug: When there is no /usr/local/madlib, installation fails due to the
non-existence of the folder when running preflight script

Fix: Detect whether the folder exists first in both preflight and
postflight scripts