How about something like this?

```csharp
RemoteSafeHandle remote = null;

try
{
	remote = Proxy.git_remote_load(repo, name, false);
	if (remote == null)
	{
		return;
	}

	int res = NativeMethods.git_remote_delete(remote);
	Ensure.ZeroResult(res);
	remote.SetHandleAsInvalid();
}
finally
{
	handle.SafeDispose();
}
```