Inspectors highlighted an infection risk in the water supply at Scotland's biggest hospital days before it opened.