INT-3453 Fix NIO Connection Race Condition

JIRA: https://jira.spring.io/browse/INT-3453

A race condition in the TcpNioConnection can leave
an assembler thread blocked when there is no data coming.

This can happen because `writingToPipe` might not be reset
before the assembler consumed the IO data.

Chane it to a semaphore so that the assembler will wait
until the data is actually written to the pipe
and will not block again in `convert()` unless the message is not
fully assembled. As soon as the write completes the semaphore is
released so that an assembler won't block once the write for the
current IO has completed.

INT-3453 Test Case

Exposes the race condition when `writingToPipe` is not reset in time
and we end up tying up an assembler thread on a socket with no data.

Examines the assembler thread's stack trace to ensure it does not
contain `ChannelInputStream.getNextBuffer()`.