Do database checks on upgrade only for versions that contain new fixes

Here's a change that will allow us to trigger DB checks on upgrade only if we have actually added something  to the integrity checking routine that we must run on upgrade. It also fixes a bug where the DB check would always run on a fresh install of AnkiDroid.

Currently, the ```lastUpgradeVersion``` value that we are storing in the application preferences is actually storing the version name like "2.0.2", which makes it difficult to compare to see if it's a newer version. This commit replaces that value with the int value of the version code. I've changed all places where this value is initially written so future versions will not introduce a string value for this any more.