San Francisco cuts deal with California water regulators to avoid severe restrictions