Simplify and improve integer overflow checks in Interop (dotnet/coreclr#21732)
- Delete unnecessary CheckStringLength calls for result of string.Length. Managed strings are guaranteed to be under 2GB bytes, so these checks were unnecessary.
- Add `checked(...)` around buffer size computations that may hit potential integer overflow. It does not look like any of these would cause a bug that would lead to buffer overrun, but it is better to catch these early.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a5b1c68d4bb8a14042e93acb8f1032db4703b943