Stochastic Thermodynamics of an Electromagnetic Energy Harvester