Cosmological wormholes in Lovelock gravity