mgmt/mcumgr/lib: Fix taskstat thread name processing
mgmt/mcumgr/lib: Fix taskstat thread name processing

The commit:
 - removes usage of strnlen to make taskstat code C99 compliant;
 - corrects thread name len, following update description of
   CONFIG_OS_MGMT_TASKSTAT_THREAD_NAME_LEN;
 - reduces duplicated code.

Signed-off-by: Dominik Ermel <1a1d45a9cc0c98a37f8d0a0d2dbe3cacc0b2344f@nordicsemi.no>

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