China's economic growth slowed to the weakest level in nearly three years in the fourth quarter as domestic demand softened.