userspace: plug thread index leak in k_object_alloc()

The thread index should be freed when the object allocation fails.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
1 file changed