fix AsyncStream eof()
closes #2090 and #2051