Battery Management for Control Systems with Energy Harvesting Sensors