Breaking out of socket read for truncated streams