gmain: define non-posix symbols
These symbols are not defined by, for example, musl.
The definition of W_EXITCODE
is taken directly from glibc, and the definition of W_STOPCODE
is taken from a similar ifndef
in gdb.
Closes #2692 (closed)
Edited by Philip Withnall