On the thermodynamics of the Hayward black hole