shill: Fix intermittent autotest failure during connect step

Autotest occassionally fails during the connect step because the client
does not get a DHCP response after broadcasting for a lease.  The log
shows that hostapd could not add the station to the driver with
error=-EINVAL.  This was caused by a race in the test framework between
killing of the existing hostapd and launching of a new hostapd.  If the
new hostapd starts before the old hostapd exists, the old hostapd will
overwrite the interface mode and sets it to station (instead of ap).

BUG=chromium-os:25034
TEST=network_WiFiManager

Change-Id: I1c909d4dd5ec49b276b5362a12ae51602e5c6638
Reviewed-on: https://gerrit.chromium.org/gerrit/14995
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
1 file changed