Fix missing EOL issue in to_json for old versions of pandas
Some versions of pandas don't add an EOL at the end of the output of `to_json`.
Therefore users could end up having two samples in the same line

Close https://github.com/huggingface/datasets/issues/2615