[corlib] Update SafeHandle dispose pattern to match .net. Fixes #25132