Fashion retailer H&M’s second-quarter profit beats expectations