[cmake] Fix git short length
Summary: The short hash length vary with git versions, so let's fix it to have the same deterministic output on every machines.
Test Plan:
./contrib/guix/guix-clean && ./contrib/guix/guix-build
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D15651