Polyamides based on aromatic diamines containing a phthalide or phthalimide group in the side chain