Algeria has recalled its ambassador to Spain after Madrid changed a 42-year-old policy towards its former colony Western Sahara.