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.