A teenager who hurled bricks at a Chinese takeaway during the Middlesbrough riot has been freed from prison after appealing his sentence.