common: Track version via SHA1 hash of firmware partitions

* Also don't flash firmware if the SHA1 hash has not changed

Change-Id: Ie2d8cc117b1a915779177357d0937892ea6a697d