Specific heat and its high-order moments in relativistic heavy-ion collisions from a multiphase transport model