[PATCH openEuler-1.0-LTS 13/31] cred: allow get_cred() and put_cred() to be given NULL.