Sydney swelters through scorching temperatures topping 40 Celsius (104 Fahrenheit), with beaches packed, bushfire warnings issued and people urged to stay hydrated.