Hong Kong's Court of Appeal has overturned a ruling against former newspaper boss Jimmy Lai's conviction and prison sentence for a fraud offence.