Fix broken thread stop handling
Merge remote-tracking branch 'minetest/master'