Ukraine's Volodymyr Zelenskiy has visited Poland following a breakthrough in a historical dispute on wartime exhumations that has stood between the allies.