An adviser to Europe’s top court said on Thursday that the independence of Polish courts could be at risk from changes made by the right-wing government.