Use newer API to get path to current executable on Mac OS X.

The functions we used before have been deprecated for many years.