A Moroccan court convicted 18 people over a series of coordinated suicide bomb attacks in Casablanca six years ago that left 45 dead.