An Italian court has jailed the captain of a migrant boat that sank in 2015, killing some 900 people in the Mediterranean's worst disaster since World War II.