Properly remove terminated thread from ready queue.

If we change the priority first, we'll remove from the wrong priority
level, oops.  Gotta change afterward.

Should improve Darkstalkers Chronicle: The Chaos Tower.
Merge pull request #5062 from unknownbrackets/thread-minor

Properly remove terminated threads from ready queue