Danish premier’s party suffers its worst election result since 1903

But Mette Frederiksen may still secure a third term in office because her rightwing rival fared even worse