tests: net: Fix possible null dereference in net_pkt tests
tests: net: Fix possible null dereference in net_pkt tests

It might be that the test might access null pointer in some cases.
In practice this is not possible as the test is using pre-defined
data when running the test.

Fixes #10777

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

punitvara/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,punitvara/zephyr,Vudentz/zephyr,finikorg/zephyr,finikorg/zephyr,nashif/zephyr,galak/zephyr,punitvara/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,ldts/zephyr,punitvara/zephyr,Vudentz/zephyr,Vudentz/zephyr,ldts/zephyr,ldts/zephyr,explora26/zephyr,galak/zephyr,nashif/zephyr,explora26/zephyr,galak/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,explora26/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,explora26/zephyr