Dissipation of diamagnetic currents and plasma heating in coronal magnetic loops