Police say more than 300 captives have been rescued from a building in the northern Nigerian city of Kaduna, with teachers from a school in the building arrested.