Sweden are through to the last 16 of Euro 2020 as group winners after a last gasp victory over Poland.