Reducing energy consumption and leakage by active pressure control in a water supply system