Fix data corruption on big messages (fixes #144)

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>