Fix NPE

Fixes https://github.com/appium/appium/issues/628
Merge pull request #632 from bootstraponline/fix_npe

Fix NPE
updated appium-io
fix bad use of path.resolve to make prefs test work
add a test for window handles idempotence
fixing some android tests
bump apidemos
fix issue where we would write to remote debugger socket after destroying it
make this test more robust