max17040: Stop fuelgauge from raising sporadically

If the next soc to be applied is greater than the previous, do
not update capacity. Fixes inconsistent battery stats while
unplugged (draining), where our battery capacity can show random
increases in value on occasion.

Borrowed some code from nvidia's max17048 driver.

Change-Id: Ia24bdfecb3ba2c3c7c36b29444be7427f8703370
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Merge "max17040: Stop fuelgauge from raising sporadically" into android-4.4