dialog: prevent double free in case of errors

(cherry picked from commit eef59c1d7b47ecc35438c01e7dcbdfeea903115a)
Fixed output redirect for "which"

Credits go to @jalung . Closes #231 .

(cherry picked from commit f89838976d3b11424cb649cd2b6f376579c42d0e)
QM_MALLOC: proper fragment debugging patterns for x86_64
(cherry picked from commit cd201b680102ffcbe554851d1e6f44ace3c72daa)
dispatcher: fix possible bogus gateways

In case the domain name can not be resolved, the destination should
be droped and the number of destinations within the set should not be
increased.

(cherry picked from commit 310dafa013b1f127c9cf60b4f7a5efac639b1aed)

Conflicts:
	modules/dispatcher/dispatch.c
Merge pull request #232 from wdoekes/wjd-misc_typos

Fix a few typo's and double spaces in LM_* messages.
(cherry picked from commit 3452fbfb7c075fe0eca6bae516eb40337d0d5b75)

Conflicts:
	script_cb.c
Fixed setting the pinging flags at start.

Related to issue #233

(cherry picked from commit d5ff4c9ce34e348866381ba26c0a58da242242cc)
core: improve CPU usage of the TCP_MAIN process

	* iterate through and close connections at most once per second
(cherry picked from commit 3ac3b042c7b74cc6c84af0a987ac65cde17f8e6b)

Conflicts:

	tcp_main.c
drouting: document the "persistent_state" parameter
(cherry picked from commit 24517fd9a7fa427dd56e23753418b1bfc3cd1791)