Reordered Apps Dir Checking

The checks for the apps directory for a device was crashing iOS 8
devices (iPad Air 2 LTE), because the directory
'/private/var/mobile/Applications' existed (but was empty).
This caused idb to set the '@ios_version' to 7.  I changed it
to check for the iOS 8 dirs first, which will definitely not
exist on iOS 7 devices.  This fix also incorporates the pull-request
for SSH connection issues.  Tested on iPhone 4 (iOS 7.1.2), iPad
Air 2 (iOS 8.1)