Fix bug of connect result callback trigger logic. Add state checking for
connect to SSID.
Change connection state checking logic.
Fix bug of Wifi connecting.