gen_buildnum_h.sh: get script path the proper way
gen_buildnum_h.sh: get script path the proper way

Also eliminates a dependency on the 'rev' command, which isn't
very common on Windows machines, especially.

This also adds compatibility for MSYSGit.

Signed-off-by: Steven Noonan <4068f0880b399410602d694b3cc711c8a8f4727e@uplinklabs.net>

tycho/crisscross,tycho/crisscross,tycho/crisscross