Fix #658: socket:read() incorrectly handles size and delimiter together