stm32f103rey6: fix thread exit

for those who want to end threads...