Stop threadend timeout when the thread ends.

Fixes threads waking up early in tests.
Don't wait on LwMutexes with dispatch disabled.