[Bug 51877] improve POSIX compatibility for wine-staging's patches/gitapply.sh