[SPARK-3135] Avoid extra mem copy in TorrentBroadcast via ByteArrayChunkOutputStream

This also enables supporting broadcast variables larger than 2G.
I think written could be 0, total could be len (i.e., deleted), and `total - written` could be `len - written`. That way all the variables mean what they say :)