Automatically reallocate the buffer if the getgrnam_r or getgrgid_r functions fail on an ERANGE error and retry.