Fixed appium script to end with a proper exit code.