spawn: prefer allocating buffers on stack for small sizes to avoid valgrind leaks

We preallocate buffers that are used after forked. That is because
malloc()/free() are not async-signal-safe and must not be used between
fork() and exec().

However, for the child process that exits without fork, valgrind wrongly
reports these buffers as leaked.
That can be suppressed with "--child-silent-after-fork=yes", but it is
cumbersome.

==3989269== 24 bytes in 1 blocks are definitely lost in loss record 2 of 11
==3989269==    at 0x4839809: malloc (vg_replace_malloc.c:307)
==3989269==    by 0x489EC28: g_malloc (gmem.c:106)
==3989269==    by 0x48E60F4: fork_exec_with_fds (gspawn.c:1879)
==3989269==    by 0x48E6C1A: fork_exec_with_pipes (gspawn.c:2214)
==3989269==    by 0x48E75CE: g_spawn_async_with_pipes (gspawn.c:792)
==3989269==    by 0x48E768F: g_spawn_async (gspawn.c:257)
==3989269==    by 0x401093: main (test-mr1902.c:16)
==3989269==
==3989269== 126 bytes in 1 blocks are definitely lost in loss record 9 of 11
==3989269==    at 0x4839809: malloc (vg_replace_malloc.c:307)
==3989269==    by 0x489EC28: g_malloc (gmem.c:106)
==3989269==    by 0x48E62F0: fork_exec_with_fds (gspawn.c:1867)
==3989269==    by 0x48E6C1A: fork_exec_with_pipes (gspawn.c:2214)
==3989269==    by 0x48E75CE: g_spawn_async_with_pipes (gspawn.c:792)
==3989269==    by 0x48E768F: g_spawn_async (gspawn.c:257)
==3989269==    by 0x401093: main (test-mr1902.c:16)
==3989269==

Work around by trying to allocate the buffers on the stack. At
least in the common cases where the pointers are small enough
so that we can reasonably do that.

If the buffers happen to be large, we still allocate them on the heap
and the problem still happens. Maybe we could have also allocated them
as thread_local, but currently glib doesn't use that.
13 jobs for wip/avoid-searching-path-2-66 in 17 minutes and 12 seconds (queued for 3 seconds)
latest
Status Job ID Name Coverage
  Style Check
failed #1114032
allowed to fail
check-todos

00:02:19

failed #1114031
allowed to fail
style-check-diff

00:02:18

 
  Build
passed #1114035
cross-android_api21_arm64

00:02:10

passed #1114036
cross-android_api28_arm64

00:01:11

passed #1114037
cross-mingw64

00:03:05

passed #1114034
debian-stable-x86_64

00:02:31

passed #1114033
fedora-x86_64

00:07:42

passed #1114040
freebsd-11
freebsd-11-x86_64

00:06:49

passed #1114041
freebsd-12
freebsd-12-x86_64

00:05:29

passed #1114042
macos
macos

00:04:27

passed #1114038
win32-ps
msys2-mingw32

00:08:27

passed #1114039
win32-ps
vs2017-x64

00:08:20

 
  Coverage
passed #1114043
coverage

00:01:14

78.4%
 
Name Stage Failure
failed
style-check-diff Style Check
 * [new tag]             glib-2.25.7             -> glib-2.25.7
* [new tag] gobject_0_10_0 -> gobject_0_10_0
* [new tag] gobject_0_9_0 -> gobject_0_9_0
* [new tag] start -> start
Couldn’t find common ancestor with upstream master. This typically
happens if you branched from master a long time ago. Please update
your clone, rebase, and re-push your branch.
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
check-todos Style Check
 * [new tag]             glib-2.25.7             -> glib-2.25.7
* [new tag] gobject_0_10_0 -> gobject_0_10_0
* [new tag] gobject_0_9_0 -> gobject_0_9_0
* [new tag] start -> start
Couldn’t find common ancestor with upstream master. This typically
happens if you branched from master a long time ago. Please update
your clone, rebase, and re-push your branch.
Cleaning up file based variables
ERROR: Job failed: exit code 1