H&M beats forecasts with third-quarter sales rebound, shares rise