Fixes unstable NetworkSenderReceiverTest

The test occasionally failed because of a race condition between
 sending a message from NetworkSender and stopping a NetworkReceiver
 instance. The test depended on the message sent to result in a
 ClosedChannelException which occasionally did not happen, because
 NetworkReceiver.stop() does not block waiting for all listening
 threads to exit. The result is that the message would be received
 and the expected exception would not happen.
The fix adds a retry loop that keeps sending messages until the
 exception manifests. Then it goes on to verify the actual
 functionality
Merge pull request #3403 from digitalstain/2.2-fix-networksenderreceivertest

Fixes unstable NetworkSenderReceiverTest