add query handler for external commands

now we can use the query handler to send external commands. Reason
is to get livestatus make use of this instead of directly calling
process_external_command1() which segfaults in case of other neb
modules loaded like npcdmod or mod-gearman.

ex.: contrib/naemon-qh.rb -c 'core command [1391099692] RESTART_PROGRAM'

Signed-off-by: Sven Nierlein <sven@nierlein.de>