Fix postmaster's handling of fork failure for a bgworker process.
Fix postmaster's handling of fork failure for a bgworker process.

This corner case didn't behave nicely at all: the postmaster would
(partially) update its state as though the process had started
successfully, and be quite confused thereafter.  Fix it to act
like the worker had crashed, instead.

In passing, refactor so that do_start_bgworker contains all the
state-change logic for bgworker launch, rather than just some of it.

Back-patch as far as 9.4.  9.3 contains similar logic, but it's just
enough different that I don't feel comfortable applying the patch
without more study; and the use of bgworkers in 9.3 was so small
that it doesn't seem worth the extra work.

transam/parallel.c is still entirely unprepared for the possibility
of bgworker startup failure, but that seems like material for a
separate patch.

Discussion: eca5789a07f42e4180a20adc9632cd15b007a3e6@sss.pgh.pa.us

lisakowen/gpdb,50wu/gpdb,greenplum-db/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb