Enhance the output sync mode.

Create a new file, output.c, and collect functions that generate output there.
We introduce a new global context specifying where output should go (to stdout
or to a sync file), and the lowest level output generator chooses where to
write output based on that context.

This allows us to set the context globally, and all operations that write
output (including functions like $(info ...) etc.) will use it.

Removed the "--trace=dir" capability.  It was too confusing.  If you have
directory tracking enabled then output sync will print the enter/leave message
for each synchronized block.  If you don't want that, disable directory
tracking.
Support the -Orecurse option properly.

In this mode we still collect all the output from a given target and
dump it at once.  However we don't treat recursive lines any differently
from non-recursive lines.  Also we don't print enter/leave messages
after every dump.  However we do ensure that we always print them once
to stdout, so the parent make will collect it properly.
[SV 39851] Reinstate stack size limit for processes spawned via $(shell)
[SV 33134] Don't try to close stdout when it's already closed.
[SV 35248] Add --debug "n" flag to turn off current debug options.
[SV 39203] Don't set MAKEFLAGS when restarting.

We are restarting with the original command line flags, so if we set
MAKEFLAGS as well that will cause double flags.
[SV 39934] Verify jobserver FDs before something else uses them.
[SV 27374] Fatal immediately on unrecoverable fopen() errors.
[SV 31326] Enhance the info on static pattern errors.
Small cleanup defining MAKEFLAGS.
Release GNU Make version 3.99.91.
Avoid compiler warnings in output.c on MS-Windows.

 output.c [WINDOWS32]: Include windows.h and sub_proc.h, to avoid
 compiler warnings for CLOSE_ON_EXEC.
Fix a typo in a comment.
[SV 40043] Set the current directory before printing errors.
Don't write "Entering" every time we re-exec for remake makefiles.
Ensure that stderr from shell functions in recipes is synced.
Ensure that output generated while reading makefiles is synced.
Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC
Remove obsolete tests.
Create a target that tests alternative configurations.