Fix app crashing when 3rd party irewall is enabled.

Try opening a socket to test if network is really avaliable. It prevents app crashing under iptable environment. e.g. Droidwall