build: Backport "generate strictly increasing git revisions"

Enhance luci-0.12's build/mkrevision.sh by backporting the code to generate strictly increasing git revisions.The corresponding check-in master was: https://github.com/openwrt/luci/commit/0856030c79f3febdafa627511cf1be4c72edf09b

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>