Thermodynamics of dynamical wormholes