Improve TCP datastream restartability.  (FS#1031)