Fix issue #1522
Optimize the fix for takeLast and handle the race condition
Make "single" support backpressure

Signed-off-by: zsxwing <zsxwing@gmail.com>
Merge pull request #1523 from zsxwing/issue-1522

Fix issue #1522