http_digest.c: SIGSEGV and OOM handling fixes