Revert "Interrupt periodic save when launching process"
Revert "Interrupt periodic save when launching process"

This reverts commit 0f3d198 (Interrupt periodic save when launching
process, 2017-09-08).

Stopping and starting periodic save when external/hook programs are run
causes deadlocks. The periodic save thread cannot be stopped/started at
will, but should be started once and run uninterrupted as long as
calcurse runs. Only if the configuration parameter is changed, must the
thread be stopped and possibly restarted.

The reasons are

- the start routine unconditionally starts a thread.
- the mechanism used to detect whether a thread is running or not, is
  designed to be used by the main calcurse thread only and with only one
  running thread of each kind (the thread ID of each running thread is
  kept in a variable; if the thread is not running, the variable has the
  main thread ID as value).

Any load hook will be run at the initial dataload, and the stop/start
calls will start a perodic save thread (this is true for the notify
thread as well). Later when threads are started, a second periodic save
thread is started (for the notify thread, a running thread is stopped
before restart).

When hooks are run by the periodic save thread, the stop call breaks
down, leading to two running save threads (if not the case already) and
subsequently to a deadlock when one thread tries to stop the other.

Signed-off-by: Lars Henriksen <a2fd37141f23d5929304549ae011a7f22ebb96a9@get2net.dk>
Signed-off-by: Lukas Fleischer <c9ca73f8336dcfb037ec2c2abf52d80a6847a5cd@calcurse.org>

lfos/calcurse,lfos/calcurse,lfos/calcurse