hostapd: fix a null pointer dereference in wpa_supplicant on teardown