Previously, when an exception occurred on a send, the
connection was not forcibly closed. When using a
CachingClientConnectionFactory, this prevented the connection
(albeit stale) from being returned to the cache.
Perform a forced (physical) close whenever a send fails.
Add test cases for both Net and NIO implementations, using
a CCCF, to verify the connection is returned to the pool so
the closed state can be detected on the next retrieval, causing
a refresh.
Also, change the synchronization in the NIO send to
synchronize on the socketChannel, not the mapper (which is
shared).
JIRA: https://jira.springsource.org/browse/INT-3163