Resolve multiple errors in daemon/diff

This patch fixes multiple errors in daemon/diff.c by resolving the common
realloc mistake of nulling but not freeing the resource on failure as well as
checking memory allocation calls for success. In addition it gets rid of a
possible error caused by the uninitialized variable pair. While this patch
resolves some issues it does not take care of proper error handling if hash_char
fails.