fix(esp_netif): Prevent null deref when checking netif type See merge request espressif/esp-idf!34911