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)
latest
Status Job ID Name Coverage
  Build
passed #11481
docker
autoconf

00:04:51

passed #11482
docker
cmake

00:02:23

passed #11483
docker
meson

00:02:42

failed #11477
docker
autoconf

00:00:41

failed #11478
docker
cmake

00:00:40

failed #11479
docker
meson

00:00:07

 
  Test
failed #11480
docker
whitespace

00:00:05

 
Name Stage Failure
failed
whitespace Test

Skipping Git submodules setup
Executing "step_script" stage of the job script
Using docker image sha256:5c0b7aefcb680779d54a7cfeca94ac44184edb5141b77feceb6f0d380a4cd39a for gcc:9 with digest gcc@sha256:5f7d96c529f9e6630be07caba107389c59d4285adaf6087cf5310a30b394a666 ...
$ git diff-tree --check origin/master HEAD
src/opus_encoder.c:903: trailing whitespace.
+ /* The number of consecutive DTX frames should be within the allowed bounds.
Cleaning up file based variables
ERROR: Job failed: exit code 1