Thermal evolution of neutron stars with internal frictional heating