Application of Landau-Lifshitz-Bloch dynamics to grain switching in heat-assisted magnetic recording