fix signal and reset-TTY-on-exit handling

occasionally, segmentation faults appeared when the program was
interrupted. This should now be fixed.

The TTY reset code should now be more robust thanks to code which was
shamelessly shoplifted from the 'ncurses' library.

Finally, a new line is now printed before exit to reduce the
likelyhood of getting a line without garbage on the shell prompt after
program termination increases.

With this patch I was not able to crash the simulations by
interrupting them at random times and I also never had to run the
'reset' command anymore. (no guarantees that it works everywhere,
though.)

Note: The POSIX signal and TTY-reset interfaces are *fun*.
adapt to the reworked blackoil fluid system and function tabulation classes

in particular, the density of undersaturated oil is now the one
specified by the PVTO keyword...