tail: improve performance when stdin is piped
#3874
Merged
tail: improve performance when stdin is piped
#3874