userspace: Fix thread index type in z_thread_perms_all_clear()
userspace: Fix thread index type in z_thread_perms_all_clear()

The type for the thread index returned by thread_index_get() must be
casted to int when comparing with (-1). Directly using uintptr_t is
breaking the ARMv8 implementation where where the check (index != -1) is
verified also when no thread index is returned.

Signed-off-by: Carlo Caione <ca4506c8c654a4ccf75802e86b5d162c1e96f065@baylibre.com>

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