Improve KafkaConnection with more tests

Handle connection failures in KafkaConnection.reinit
Set _sock=None in close()
Also check for no _sock when checking for _dirty
Add a few more debugging log messages
Implement the skipped connection tests in test/test_conn.py
all kafka messages have a 4 byte header, so _mock_sent_size functions as a flag to signal whether we've returned the size header or not.  The _mock_data_sent value is really just a pointer into the payload data in case the requested num_bytes is less than the total payload size.