Polish authorities said the country came “very close to a blackout” before the cyberattack was thwarted late last month.