A Nigerian court has convicted separatist leader Nnamdi Kanu on charges related to “terrorism” after a years-long trial.