Fix, or at least make less common, deadlock in the thread sample.
Don't always deadlock when "Stop the last spawned thread" menu command is
selected. There is still a problem with a race condition which could result in
a crash when dereferencing an invalid pointer, but at least this doesn't
happen all the time, unlike the current bug.
Of course, the real solution would be to properly rewrite the sample to show
how thread deletion should be handled correctly...
See #14891.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73568
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775