handle host disconnection during data transfer, fix #9