net: ieee802154: Fix possible null pointer de-reference
net: ieee802154: Fix possible null pointer de-reference

ieee802154_scan() checks if ctx->scan_ctx (scan) is NULL what implies
that this can be true, but de-reference this variable before this
check what may cause a problem.

Fixes #23299 [3]

Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel.com>

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