Improve safety of ByteVector when using ByteBuffers and speed up copyToArray