ffmpeg: set GIT_DIR so head builds can determine the version

Fixes #29118.