Toymaker Lego announced plans to lay off 8 percent of its workforce as it reported a 5 percent fall in mid-year revenue.