Fix the implementation of OnCommandExit for Mac OS X.