mac80211: fix scan races and rework scanning