Check the network connection before the network scan is started. This finally seems to have fixed bug 391150. BUG: 391150 (cherry picked from commit bb659ab2)