hooks.c: Fix window preparation in interactive mode
hooks.c: Fix window preparation in interactive mode

In commit 2857bac (Fix segfault when running hooks in non-interactive
mode, 2016-01-16), we added checks to fix a segmentation fault in
non-interactive mode. However, at the same time, that commit broke
window preparation in interactive mode.

When wins_prepare_external() is called, the UI mode is changed to
command line, such that we cannot determine whether we need to call
wins_unprepare_external() when returning from the hook. As a workaround,
we now store the mode in a temporary variable.

Signed-off-by: Lukas Fleischer <c9ca73f8336dcfb037ec2c2abf52d80a6847a5cd@calcurse.org>

lfos/calcurse,lfos/calcurse,lfos/calcurse