Clone only the needed portion of an ArrayBuffer

According to the spec, when cloning a typed array that is a view of a larger buffer, the entire buffer should be cloned and then the view recreated on that buffer. Firefox used to copy only the portion within the view, which observably differs from the spec. Its behavior changed long ago, which can result in hugely inflated memory usage.