Heatwave grips Poland as authorities brace for 40C temperatures