The Polish prime minister said he had spoken to EU leaders who had given him support and assurance that Poland’s border security was a common task for all.