Contributed patch from Tom Lane <tgl@users.sf.net>.  Merge conflicts due to
different coding style and lingering obsolete compiler support resolved.
New routine hasnonemptyout() for minor improvement to new fixempties().
Use flag argument to combine copy(nonempty)* routines into copy* routines.
Indent reduction in fixempties().
Rework into Tcl 8.4 coding style (closer to original Spencer).
merge 8.4
3604074,3606683 Rewrite of the fixempties() routine (and supporting routines)
to completely eliminate the infinite loop hazard.  Thanks to Tom Lane for the
much improved solution.