The youth justice department will conduct an urgent review into how long a 13-year-old boy was held in solitary confinement at a Townsville detention centre.