Make to_csv return a string in case no buffer is supplied.

Fixes issue #6061.