fix for issue 391 and issue 307

Fix Issue307: heartbeat.py had a fix to add the stop() method but it is not called by tornado or select connection.       Added to base_connection close.

Fix issue391: avoid sending the error None to _handl_error, assume disconnected when writing returns a read error.