Children in South Yorkshire were detained by police over a thousand times last year, new figures show.