Return promise resolved after CSV is written