Split wpa_supplicant_event_scan_results() into helper functions