Build `data` after all chunks are received

This prevents encoding trouble.