Fix reinplace in macports package to work on both 10.7 and 10.8

reinplace on OSX 10.8 seems to behave differently, this change has been tested
on a few 10.8 and 10.7 machines.
Merge pull request #2498 from jcftang/devel

Fix reinplace in macports package to work on both 10.7 and 10.8