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.
Catch errors thrown in the OnError handler.

#1836
Fixed sql recovery logic.
- Get rid of clear failed and set failed since it was
  causing deadlocks.

#1831
Fixed issues with dupes in ScaleoutStore.
- If second binary search fails bail out.

#1831
Merge branch 'release' into dev