Fix sending fragmented handshake

Previously, writing the handshake in pieces would repeat the initial
part of the handshake instead of continuing on properly, causing the
client to (correctly) recognize the stream as corrupt.
Simplify random stream tests

Rather than using a circular buffer, we use an optimistically large one. The previous
implementation would get stuck of there was too little space left at the end of the
circular buffer to write a segment.

This behavior of the stream getting stuck if you give it only very small ciphertext
buffers is unfortunate. To get around that (and not have to start dealing with
memory management) we would have to be able to incrementally encrypt and authenticate.
Libsodium does not support that, though.