thread state coordinator: added thread death support and more tests.

Tested two pending stops before notification, where one of the pending stop
requirements was already known to be stopped.

Tested pending thread stop before notification, then reporting thread with
pending stop died and verifies pending notification is made.