Fix encrypted retransmits.
When doing encryption we write our encrypted output back to the same pointer, this leads to issues when a retransmit is requested, as our data buffer is now already encrypted. This corrects that by in that case memcpying the data to a local buffer.