[MacOS] Fixed the environment variable setup logic

This broke due to layout of the app bundle changing recently.