AFAICT `git_reference_free()` already checks for NULL, so this isn't necessary.