Quit pkg ssh if an error occurs while reading