plugins/power: Check battery state when reporting energy rate
According to the documentation of both Solid and UPower enrgy rate should be positive when discharging and negative if charging, but that seems to be incorrect in at least some systems. So use the battery state to make sure we have the right sign for charge/discharge rate.