Update wlan.py

Fix some bugs in refreshing network.