net: shell: ensure the shell `sh` is valid before call shell_printf

It is possible that the `sh` was not set before use.
This change adds a NULL check for `sh` in the following macros:
PR, PR_SHELL, PR_ERROR, PR_INFO, and PR_WARNING.
In case `sh` is NULL, the above macros will call `printk` instead.

Fixes #68793

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
(cherry picked from commit 7b8a9e1818f75a2a61ea40537a9d4299eb3225a6)
1 file changed