Antislavery ideology was used to dismiss Egypt’s empire and justify Britain’s own.