gradlew-fdroid: use last duplicate key like java.util.Properties
Fixes #1131 (closed).
I didn't test the whole script including downloading/running gradle, but I ran the script in an app repo until after it prints the version it finds and verified it prints the correct version now.