fix the bug for detect ssh cmd stream complete