Scottish Water has been accused of putting people's health at risk after failing to shut off supplies contaminated with E-coli for almost a year.