Thames Water has had its credit rating downgraded to “junk” status by influential ratings agency Moody’s.