tests: net: icmpv4: Test NULL ptr in proper time
tests: net: icmpv4: Test NULL ptr in proper time

The code tried to use the allocated pkt ptr before checking for
NULL value.

Fixes #21699
Coverity-CID: 206608

Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

nashif/zephyr,galak/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,Vudentz/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,finikorg/zephyr,nashif/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr