Write to UTF-8 file in Python,file.close()