QPID-5576 : Detect closure of sockets better and do not leave threads waiting for input which will never come

git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1612555 13f79535-47bb-0310-9956-ffa450edef68
QPID-5910
The previous way of computing required credit was apparently
pretty slow -- perhaps because it is doing some  unnceessary
copying down in its guts.  (Which theory I did not prove.)
And it was running while a lock was held, which caused a
significant throughput regression (which was reported as an
enormous latency regression.)
The simpler means of calculating credit in this diff removes
most of the problem.


git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1612559 13f79535-47bb-0310-9956-ffa450edef68