top: enable screen contents preservation at end-of-job

The title of this commit is actually quite misleading.

Were it more accurate, it would at least mention a tty
emulator's scrollback buffer, which was the cumulation
of a long pursuit to reduce the SIGWINCH overhead when
a window manager carelessly floods an application with
that signal *while* a user is still resizing a window!

Disabling and enabling that scrollback buffer resulted
in the final top display replaced with original screen
contents, a phenomenon acknowledged at the time but it
also represented a user interface change which has now
produced the first request for return to old behavior.

After the SIGWINCH dust settled, another problem arose
regarding behaviors under the 'screen' window manager.
In response, top was refactored a bit to avoid display
corruption. That was before discovering 'screen' could
duplicate the scrollback buffer behavior top expected.

As it turns out, the 'screen' refactoring had probably
made scrollback buffer manipulation unnecessary. Still
one could argue that a window should not be allowed to
scroll while a constantly updating program was active.

The solution represented in this commit returns former
behavior at program end (retaining top's last screen).
And if we ever wish to disable scrollback buffers, the
associated logic was retained but made conditional. It
is not reflected in configure.ac but might be someday.

Lastly, this commit corrects cursor positioning when a
^C is issued under 'Fields Management' at any terminal
that didn't have a scrollback buffer (i.e. a console).

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=977561
http://www.freelists.org/post/procps/top-library-miscellaneous-tweaks,1
. screen program refactor
commit 0fe393ff270922cd4f6edbcaabba006314e73a37
. scrollback buffer disabled
commit dedaf6e1a81738ff08ee8e8523871e12f555ad6d
. sigwinch management defines
commit adca737758e5afc7be344a736953931894cbc19f
commit 4f33b6b8c56464b4044deb29a3bb0e32622e108f

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: refine some miscellaneous signals interrupt stuff

This commit mostly justs renames a few identifiers but
it also will now suppress any end-of-job report if top
wasn't ended via the 'q' key convention (i.e. signal).

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: cursor repositioning includes line oriented input

A recent patch introduced the ability to recognize the
need to reposition the cursor at suspension or program
end. There remained unmet 1 additional potential need.

This commit extends that ability to embrace line input
so that if a user issues ^Z or ^C while being prompted
the resulting shell output will no longer be embedded.

Reference(s):
http://www.freelists.org/post/procps/top-library-miscellaneous-tweaks,7
commit 5c974ff44da4fbbb9170dd15bdd81555c62c31a9

Signed-off-by: Jim Warner <james.warner@comcast.net>
Merge branch 'master' of git://gitorious.org/procps/procps