kernel: fatal: check for esf validity when inspecting nested IRQ
kernel: fatal: check for esf validity when inspecting nested IRQ

For architectures that support detection of nested interrupts,
we need to check the validity of the exception stack frame,
before we can supply it as a pointer to the function that
evaluates whether we are in a nested interrupt context. This
commits adds the required esf pointer checks in z_fatal_error().

Signed-off-by: Ioannis Glaropoulos <5921cc8bab7e1d4329f52fd8f6268f9692e3de80@nordicsemi.no>

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