Fixed infinite loop described in INT-3453.

Fixed an infinite loop in the `getNextBuffer()` method of `ChannelInputStream`.

JIRA: https://jira.spring.io/browse/INT-3453

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.
Wow! Was going to say the same - it's just a race condition around `writingToPipe`.
Need to fix other way...