Fixed timeout code, ensure appium is cleaned up