This week's Mono fixes

Workaround debugger deadlock
Unregister threads on pthreads platforms