argv: ensure closing parenthesis in variables

While format_expand_arg() can assume a variable is well formed,
format_append_arg() should not.

A command using '%(prompt' without closing parenthesis causes Tig to
segfault. This is due to format_append_arg() which assumes the presence
of a ')' char, resulting in the 'next' variable being 0x1 (NULL + 1).

This patch checks for this case and return FALSE in consequence.

In the meantime, constify variables in these two functions.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Merge pull request #291 from vivien/argv/closing-parenthesis

argv: ensure closing parenthesis in variables
Move enum input_status to prompt header
Add support for running scripts using :script <file>
Add TIG_SCRIPT and TIG_NO_DISPLAY environment variables

The former allows to execute prompt scripts automatically on startup and
the latter forces Tig to not render anything to the terminal.
Add :save-display command

This allows to dump the current ncurses screen data to a file. The main
use is for testing. The command optionally takes a file name.
Add test framework

This adds a small test framework and updates all existing tests to use
it. Tests are now implemented using shell scripts and integration with
the build output is much improved.
Add test for tigrc compat errors