Update gitversion.h only when necessary.

Avoid unnecessary recompiles.