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.

The `update_version` script used by other builds
works correctly with git worktrees.

Signed-off-by: Ralph Giles <giles@thaumas.net>
4 jobs for worktree in 4 minutes and 50 seconds (queued for 3 seconds)