meson: fix get-version script for git worktrees

For git worktree directories .git is not a directory
but a file that points to the real .git dir.
7 jobs for meson-get-version-git-worktree in 5 minutes and 13 seconds (queued for 3 seconds)