Fixed infinite connection loop when device has no network.

When the device has no network or is in offline mode the code enters in a loop, attempting (and obviously failing) to ping the servers. This brings to 100% CPU usage and battery drain.
This patch simply avoids to reschedule a connection attempt when there is no network.

A typo in a log message has been also fixed.