debug: tracing: Use proper API to fetch thread name
debug: tracing: Use proper API to fetch thread name

Use k_thread_name_get API to fetch thread name.

Fixes: #20509
Fixes: #20510

Signed-off-by: François Delawarde <f957da5b594b0b24fbb562a75e0fedb85824b721@oticon.com>

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