src: limit Buffer::kMaxLength to 1TB
This change has no real effect for now, as the V8 maximum typed array
length is still 2**32
. When V8 is updated to version 11.9 or later, the
limit will be 2**53-1
on 64-bit architectures, much larger than any
reasonable amount of RAM. This caps the limit at 1TB, which is already
very large and corresponds to the maximum memory that AddressSanitizer
allows to allocate.
Refs: https://github.com/nodejs/node/pull/49876 Refs: https://github.com/nodejs/node-v8/issues/268