Optimize GC.AllocateUninitializedArray and use it in StringBuilder (dotnet/coreclr#27364)
* use GC.AllocateUninitializedArray for allocating internal char buffers
* force inlining of AllocateUninitializedArray to have no perf hit on the small buffers hot path
* insrease the threshold from 256 to 2048 bytes
* use Unsafe.As instead of a cast
* remove the size precondition from AllocateNewArray method, the called AllocateSzArray is responsible for handling negative size
Commit migrated from https://github.com/dotnet/coreclr/commit/
c382edf50b2aadfc4f39d16fc53ea65ed35331e3