Extend test thread args lifetime

The argument passed to each thread in test-pthread.c indicates a thread
number to report when finished. This value is read out by the thread
into a local variable early in the thread's execution. Currently, the
address passed as this argument is the address of a loop local. However,
it is possible that the created thread will not be scheduled to run or
will not read the argument before the thread creation loop finishes and
the local is destroyed. This can lead to odd behavior, usually observed
as multiple threads reporting the same thread_num.

Fix this issue by storing the thread arguments in a parallel array to
the array of threads. This ensures that the thread arguments are in
scope as long as the threads themselves.

Discovered with tests/test-pthread with AddressSanitizer enabled.
11 jobs for test_thread_args_lifetime in 10 minutes and 58 seconds (queued for 11 seconds)
latest
Status Name Job ID Coverage
  Build
passed meson android arm64 fedora #13399961

00:02:38

passed meson macos #13399959
gst-macos-10.15

00:04:18

failed meson-mingw-w64-build #13399956
allowed to fail

00:07:36

manual meson msys2 #13399960
docker windows 1809 allowed to fail manual
passed meson-shared-build #13399954

00:04:32

passed meson-static-build #13399955

00:04:15

passed meson vs2017 amd64 #13399957
docker windows 1809

00:01:20

passed meson vs2017 x86 #13399958
docker windows 1809

00:01:18

passed mingw-build #13399953

00:04:40

passed shared-build #13399951

00:10:57

passed static-build #13399952

00:08:14

 
Name Stage Failure
failed
meson-mingw-w64-build Build
mktexfmt [INFO]: exiting with status 0
ninja: build stopped: subcommand failed.
Uploading artifacts for failed job
Uploading artifacts...
build-*/meson-logs/*txt: found 1 matching files and directories

WARNING: prefix-*: no matching files
Uploading artifacts as "archive" to coordinator... ok
id=13399956 responseStatus=201 Created token=nydEHdGg
Cleaning up file based variables
ERROR: Job failed: exit code 1