When draining previous queue don't trip task.
- Only create a new tcs if necessary
- Added unit tests.

#1835
Never transition from Closed to another state.
- Make sure the closed state is terminal
- Added unit tests.