CRASH in Windows attached-but-never-scheduled thread
When we attach on Windows we point each thread's context to our takeover routine, storing its interrupted PC in our heap. When we go to detach, we can throw away that data before the target thread is ever scheduled, leading to a crash when it finally runs our code.
We can't just return from the intercept code, like we can for other interceptions, because the continuation PC is dynamic and in our heap. So on exit we should go through the never-scheduled threads in takeover_table and revert the context settings.
I observed this crash in the drcacheoff.burst_* tests with VS2017 as part of #2924 (closed), after fixing #4052 (closed).