Fixed premature g_clear_error()

When task fails while being fetched error is prematurely cleared in
archive_finish_callback of both fetch_git.c and fetch_http.c.
This patch moves g_clear_error() to task_handler() after it is sent to the
client.
Bunch of cmd_watchdog fixes.

This patch fixes a couple of cmd_watchdog memleaks and segfaults. User input is
now more strictly sanitized and it is a bit more userfriendly now.
Bunch of cmd_log fixes.

This patch fixes a couple of cmd_log memleaks and segfaults.
Bunch of cmd_result fixes.

This patch fixes a couple of cmd_result memleaks and segfaults.
Merge pull request #9 from sm00th/task_error_handling

Fixed premature g_clear_error()
Merge pull request #11 from sm00th/cmd_fixes

cmd utils fixes
fix test_fetch_git to propagate error