[sanitizer] Fix crash in getgrnam_r and similar interceptors.

When no matching record is found, getgrnam_r return 0 but sets result to NULL.
Should fix PR19734.