Fix py33 compatibility issue

This patch fixes the py3 compatibilty issue in csv writer. With py3
file objects should be opened with newline=''. For more details
see https://docs.python.org/3/library/csv.html#id2

Change-Id: I8917f5b2e002595e02596bfade109b207e66e006