Regular maintenance, upgrading old pipes, and installing water sensors can help avoid major plumbing problems down the road.