cleanup + debug logging
loop based on isClosed to accomodate SSL sockets
patch by Mikhail Stepura; reviewed by jbellis for CASSANDRA-6349
Merge branch 'cassandra-2.0' into trunk