Free energy of the Frohlich polaron in two and three dimensions