driver_bsd.c: Reduce code duplication between hostapd and wpa_supplicant