After a series of humiliating defeats, pollsters made an impressive comeback in 2017