H&M posted a much better-than-expected profit for the latest quarter, sending its shares soaring.