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 #11 from sm00th/cmd_fixes

cmd utils fixes