Fix #887 - ArrayIndexOutOfBoundsException opening stats

Fix #887 - I was unable to reproduce this bug on any device other than the Genymotion 2.3.7 emulator, but I went ahead and added some safety checks to prevent the exception. Also added connectivity checks before refreshing stats.