Increase fork signal safety for single-threaded processes [BZ #19703]
This provides a band-aid and addresses the scenario where fork is
called from a signal handler while the process is in the malloc
subsystem (or has acquired the libio list lock). It does not
address the general issue of async-signal-safety of fork;
multi-threaded processes are not covered, and some glibc
subsystems have fork handlers which are not async-signal-safe.
(cherry picked from commit
56290d6e762c1194547e73ff0b948cd79d3a1e03)
(cherry picked from commit
2143af6a47027c48d8dc168e255d8f527377bc56)