test-wrappers: Copy strings that might come from getenv()

It is not safe to assume that the result of getenv() is not invalidated
by a subsequent call to setenv(), and dbus#240 demonstrates that this
can be a problem in practice when running Windows code under Wine.

Closes: dbus/dbus#240
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 jobs for test-defend-getenv in 24 minutes and 27 seconds (queued for 83 minutes and 7 seconds)
Status Job ID Name Coverage
  Build
manual #65516
allowed to fail manual
build:buster
passed #65510
build:cmake

00:02:48

passed #65507
build:debug

00:07:30

manual #65512
allowed to fail manual
build:i686-w64-mingw32-cmake
passed #65511
build:i686-w64-mingw32-debug

00:03:02

manual #65515
allowed to fail manual
build:jessie
manual #65509
allowed to fail manual
build:legacy
passed #65506
build:production

00:05:15

manual #65508
allowed to fail manual
build:reduced
passed #65513
build:x86_64-w64-mingw32

00:03:06

passed #65514
build:x86_64-w64-mingw32-cmake-debug

00:02:44

manual #65517
allowed to fail manual
build:xenial