append payload to attachement header stream, fix irregular chunked encoding