Court of Appeal overturns cuts to prison legal aid