Fix to PromiseStream.take() to track state correctly and fix another potential race condition