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:
https://github.com/openwrt/luci/commit/0856030c79f3febdafa627511cf1be4c72edf09b

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Merge pull request #254 from hnyman/luci-0.12

build: Backport "generate strictly increasing git revisions"