BUGFIX: child process counter synchronization

Quite huge fix. It turned out that there is no way to correctly
synchronize child process counter in SIGCHLD handler function. What is
more calling non-async-safe inside it is also a bad idea (printing
functions, mutex locking).

* Makefile
Added LDFLAGS with '-pthread'.

* include/smime-gate.h
* src/smime-gate.c
Added function child_process_guard(). It is a start routing for new
thread, which handles child process reaping after they become a zombie.

* src/main.c
New global variables: 'sigchld_notify' and 'sproc_mutex'. Changed type
of 'sproc_counter' back to int (it is now guarded by mutex).
Added code starting a new thread (aka "child process guard") and mutex
locking for access to 'sproc_counter'. Some cleanup.

* include/system.h
Adjusted value of UNSENT_SLEEP. Added SIGCHLD_SLEEP.

* src/signal.c
Rewrote sig_chld(), now it only sets a flag for child process guard
thread.