Fix sending of messages from XHR by shrinking the underlying buffer to the size of the Uint8Array.