shell: modules: do not use k_thread_foreach with shell callbacks

Always use k_thread_foreach_unlocked with callbacks which print
something out to the shell, as they might call arch_irq_unlock.
Fixes #66660.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
(cherry picked from commit 4c731f27c6da917d7f4abaa10270bb2440423b17)
1 file changed