Mattel beat forecasts in the second quarter as bored kids badgered their parents to buy Barbie dolls and Baby Yoda.