Recalculate numWaitThreads all the time.

Before, it could go negative by having a thread woken a second time
(e.g. because of a delete) before it actually scheduled and woke up.
Merge pull request #1960 from unknownbrackets/scheduling

Recalculate numWaitThreads all the time